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