---

How to Undo and Redo in Vim / Vi

Vim keeps track of all the changes you made in the current session. The undo command undoes one or more changes in the order in which they were made.