A Modern Undo - Making undo usable beyond the last few changes
September 6th, 2006
Undo is one of the most fundamental features of modern software applications, yet it has hardly evolved since it was invented. And this is even though it widely acknowledged to be mostly useless when going beyond a few changes. This article presents a set of solutions to make undo far more useful. They not just blue sky ideas but actual features implemented and functional in e - the Collaborative Text Editor for Windows.
“By [undoing] repeatedly, you can gradually work your way back to a point before your mistake. This is convenient if you’ve made a mistake four or five commands back. It is marginally useful if you’ve made a mistake twenty or thirty characters back. And it is completely useless if your mistake is ancient history.” - Learning GNU Emacs (page 42)
Most modern software has an unlimited undo history, tracing the changes all the way back to the document creation. Yet, as the above quote attest, it is mostly useless beyond a few edits.
For some reason the introduction of unlimited undo seemed to be the end of innovations in this area. Maybe it was the because of the name. It was a convenient tick mark in the feature list, and what could you possible wish for beyond “unlimited”?
The main reason that undo has been mostly useless beyond the last few changes is that users get anxious in three ways:
- They lose any idea of where they are in the undo history.
Solution: Keep them oriented with a Visual Undo History. - They get unsure about what they actually just undid.
Solution: Show the actual change in context. - They get afraid of losing what they just undid.
Solution: Ensure they never lose their old changes by branching.
A Visual Undo History
By showing a visual representation of the undo history, we help the user to keep his orientation. We can even add helpful markers like for when the document was last saved. This also makes it easy to jump around in the undo history.
Being capable of quickly jumping back and forth from a previous document state can be extremely useful. Anybody who have done some writing have probably tried to let some paragraphs, which should be deleted, stand because of a nagging feeling that parts of it might be useful later. When you know that you can always jump back and retrieve whatever parts you find useful, you can write much more freely.
Visualizing the Undo History

The undo history is shown in a separate window which updates live as the user types. The vertical line of small circles on the left shows the history of the changes. Each circle represents the document as it was at a specific point in time. By clicking on a circle the user can revert the document to the previous state.
To the right of each circle is a one-line summery of the changes that lead to it’s current state. Changes are indicated by colors: green for insertion and red for deletion. It is put in context by the gray text surrounding it. The window is resizable so you can easily enlarge it to see more of the change.
The solid blue circle indicates the users current position in the history and the small marker (in dark blue) indicates when the document was last saved.
The history is pretty terse but users quickly learn to scan over it, easily spotting the major insertions and deletions.
Showing the change in context
For the undo history to have any value, we have to show the changes in context. Showing the user that he deleted a few letters in a set of changes that could be done hours (or days) ago, doesn’t give him much idea of what really happened. But if you show it in context, with the words that the letters were part of surrounding them, it becomes much easier to remember where the change fit in the bigger picture.
Branching

What happens if you undo a lot of changes, start making new edits and suddenly discover that you undid too far? How do you get back what you undid by mistake? In most applications you don’t. Everything that was underneath you in the undo history was lost.
By allowing branches in the undo history any such loss can be avoided. Whenever you go back in history and start making changes a new branch is created.
Basically your work is held to be sacred, and an application should never let you accidentally lose any work. So you can always go back to a previous branch and continue to work from there, or maybe just copy the useful parts back to your current branch.
Persistence & Crash recovery
In just about all applications the undo history is lost the moment you close the document. There is really no reason for this since the undo history (if it is properly implemented) hardly takes up any space, and there is no guarantee that you won’t need it at a later time.
In e you always have the full undo history, even after reloading a document from a previous session. Should the computer crash (or lose power) while you are working, it will just start up where you left of.
Innovation
It is amazing that a feature as fundamental as undo has seen so little innovation over time. And it is even scarier that it has been implemented in a way that leaves anything beyond the last few changes mostly useless. Especially considering how many system & programmer resources that are used to keep track of the unlimited undo
It really makes you wonder how many other fundamental software features that could be radically improved if you just looked at them with new eyes.
Reality Now
So is this the pinnacle of undo functionality. Not at all. There are lots of possible improvements, like partial & selective undo or interactive diffs, which are obvious next steps and could be very useful.
But it is easy just to come up with critique and blue sky ideas which have no basis in reality. So I have limited this article to features which are actually implemented and functional, so you can try them out in the e text editor right now.
Experience with the text editor has shown that these basic improvements to the undo functionality greatly improves the writing experience. Making users much more confident in modifying and experimenting with their text.
It is my hope that showing that this is possible will raise the expectations of users, so that they will no longer accept applications that routinely lose or make inaccessible parts of their work.