I need to bring it back somehow
If you haven’t left your game, Flowlab now has an undo feature in the bottom right of the editor. This helps with coding mistakes like accidentally removing code, bundles, and cut wires.
The undo only works on active editor, so leaving the game will reset the undo list.
but the timer wont stop when mario dies or when he touches the flagpole
The undo feature only works by object type, so you would need to press undo in the object with missing code.
If you have reloaded the game, then your undo list has been reset and would need to remake the code.