Restore from Diff in Vim
I often use diffs in Vim to compare my current file with the previous Git commit. vim-fugitive is one way to do this, via commands like :Gdiff
or :Gvdiff
(vertical option).
From this diff state, we can restore the code from one pane to the other using the command :diffput
. This is useful for restoring one line, or a range, from the previous commit to my working copy.