This answer says:
Vim\'s undo/redo system is unbeatable. Type something, undo, type something else, and you can still get back the first thing you typed
A lot of this is summed up here:
http://vim.wikia.com/wiki/Using_undo_branches
If you're using vim, you can navigate through the undo tree using:
u
: (undo) move back in the undo treeCtrl+R
: (redo) move forward in the undo treeOther ways of bringing document back or forward in time:
:earlier 15m
: move back in time 15 minutes:later 15m
: move front in time 15 minutes