I want to be able to see a list of previous versions of a file in a git repo, select one of them to see a diff, and choose which parts from that version I want to restore, something like git checkout -p
. I looked a bit at Neogit and Diffview’s documentation but haven’t figure out a way to do this, I’m wondering if anyone here has.
You can kind of do it with fugitive.
You can use :0Gclog
, it will open list of commits to current file. Once you find interesting revision you can run :Gdiffsplit
(or :vertical Gdiffsplit
) and it will open diff view between selected history version and current version. In diff view you can use :diffget
on interesting chunk, or just copy paste interesting bits.