Move Undo (except undo follow) to the common pipeline
Same as !2474 (closed) but without follows, these are complicated enough to be done in a separate MR.
Same as !2474 (closed) but without follows, these are complicated enough to be done in a separate MR.