For those interested, here's the Vim docs for the undo tree<p><a href="https://vimdoc.sourceforge.net/htmldoc/usr_32.html" rel="nofollow">https://vimdoc.sourceforge.net/htmldoc/usr_32.html</a>
If I understand correctly, the vim undo tree is a superset of your approach: in vim you can go forward and backward in time, seeing all versions of the file, and need not explicitly deal with the tree.