It would be interesting to be able to see all edits as individual patches/diffs that you can commit/discard individually. Like a mini automatic git inside the editor, automatic in the sense that every "edit" creates a commit, undo/redo move HEAD.
This would be entirely optional, you can continue using Undo/Redo as usual, but if you need to do a more complex history operation you can open this "git" view and operate on the edit tree directly.
Photoshop has this nice undo panel where you can see individual edits and click your way to the desired point in history:
https://www.bwillcreative.com/wp-content/uploads/2020/08/how...
One can imagine such a view in a text editor, where each entry shows a diff of what that step did.