change back vi code example Example 1: undo in vim u -> undo CTRL + r -> redo Example 2: vim redo R (ctrl + r)