7

I use the builtin VC package and it's very nice that when I do a diff of changes in the current file then I can revert any hunk in the diff quickly with C-a

But sometimes I don't want to revert the whole hunk, only certain lines and keep other changes in the hunk. Is it possible somehow? Reverting individual lines, instead of the whole hunk?

Tom
  • 1,190
  • 7
  • 16

1 Answers1

6
  • Magit can do this by limiting the revert action to the region.

  • With the built-in diff-mode you can get the same kind of effect by splitting the hunk into portions using diff-split-hunk which is bound to C-c C-s by default.

Drew
  • 75,699
  • 9
  • 109
  • 225
rpluim
  • 4,605
  • 8
  • 22
  • 2
    I don't use git, so I can't use magit, but I tried diff-split-hunk and it works well. Thanks! – Tom Jul 13 '18 at 12:06