Is there any way to add an undo button so it just takes you back to your previous action?
You'd probably need to do it manually, something like [[Undo]](former section). I don't think there is an automatic way to back up. You'd have to write each one.