If you change undoafter to another page's revision id. It will be treated as a "clean undo" (Related: T259014). But I think it should not.
Step to reproduce:
- Access ?tltle=Foo&action=edit&undo=FooID&undoafter=BarID (You can change page names for {{fullurl:Foo|action=edit&undo={{REVISIONID:Foo}}&undoafter={{REVISIONID:Bar}}}} and preview it on wiki)
- Save it without any changes
- Result: It pastes the content from Bar to Foo.
- But your edit is marked with mw-undo tag, and previous edit is marked with mw-reverted tag. And that user will get a "undo notification". These three things shouldn't happen.
Example: The undo link, Reverted edit, Undo edit