You can undo one operation by pressing u in VI
U undo the last step operation
Ctrl+r Redo the previous undo operation
Attention:
If you enter "U" two times and your text reverts to the original, it should be that your vim is configured in VI compatibility mode.
Redo
If you undo too much, you can enter Ctrl-r (redo) to rewind the previous command. In other words, it revokes a revocation. To see an example of execution, enter Ctrl-r two times. The character A and the spaces following it appear:
Young Intelligent Turtle
There is a special version of the Undo command: "U" (line undo). Line Undo Command undo all in previous edit line
On the operation. Enter these commands two times to cancel the previous "U":
A very intelligent Turtle
XXXX Delete very
A Intelligent Turtle
XXXXXX Delete Turtle
A Intelligent
Recover rows with "U"
A very intelligent Turtle
Undo "U" with "U"
A Intelligent
The "u" command itself changes itself, "u" command undo operation, Ctrl-r Command redo operation. It's a little messy, but no.
Worry, with "U" and ctrl-r command you can switch to any state.
Popular text editors often have forward and backward functions that move back and forth between locations that have been browsed in a file. Use Ctrl-o in Vim to perform the back, using Ctrl-i to perform the advance.
Related assistance:: Help Ctrl-o: Helping ctrl-i: Assist Jump-motions
Vim Undo fallback operation