質問

I know how to get to a diff from an older commit: get to *magit-log*, and "click" on the commit. How to get a particular change in the diff applied in reverse? I want it to just modify the file (and buffer, if open).

役に立ちましたか?

解決

I was going to offer a way to do it in vc mode, but this question caused me to discover exactly what you want(I think)

Move your point to the change you want to revert and type v (magit-revert-item)

If you then go to magit-status window you will see that there is an unstaged change with the reverse of the change.

That's way easier than the vc-mode way which is to C-c C-r (diff-reverse-direction) and then C-c C-a (diff-apply-hunk).

Either one is pretty darned handy IMO

他のヒント

Go to the hunk you want to undo and hit C-u C-c C-a.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top