History is a tree
u and U are all you need if you think of your history as a straight line.
But it isn’t always that simple. Sometimes you undo a few steps, then start
editing again. In many editors, that throws away your redo history, and the
text you had before the undo is gone for good.
Helix keeps the whole tree of changes, so you’ll never find yourself in that situation.
This is best shown with an example. Say you have three lines, and you delete the first one:
draft two
draft three
Then you delete the next one:
draft three
You change your mind and undo, then delete the last line instead:
draft two
If you now decide you wanted the draft three version after all, you’re in a
sticky situation. u takes you back to the two-line state, and U only
takes you forward again along the new branch. The first half of the
checklist walks you through this exact workflow — follow it and see for
yourself.
Luckily, Helix has another pair of commands. Alt-u and Alt-U move to
older and newer states in the history tree, visiting every state in the
order you made it, whichever branch it’s on. Keep pressing Alt-u and you’ll
find your lost text eventually.
The last two checklist items have you try them. On a Mac, alt is the option key.