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
If you're using vim, you can navigate through the undo tree using:
u
Ctrl+R
Other ways of bringing document back or forward in time:
:earlier 15m
:later 15m