Wait until you see what intellij can do. It can do that, while also layering it in a logical, graphical diff viewer
I use https://github.com/mbbill/undotree but if that's not to your taste there are many others.
Edit: Screenshot (with an unusually blue Emacs theme): https://www.emacswiki.org/emacs/UndoTree#h5o-5