I ran into this problem enough that I wrote a python script to help: JulianKingman/bambu-print-resumer
It can be tricky to figure out which code needs to be kept and which code can be ignored, particularly as bambu has special requirements for the comments.