And Vim will also let you go back to any prior state as long as you still have the file open. You can go back to a specific date/time, revert the last 5 minutes etc.
You can enable Vim's persistent undo by setting undofile and undodir options, that way undo works across restarts, no need to keep file open. Another cool feature is Vim's internal undo tree, which allows you to access changes that you undo-ed and then overwrote.