Вопрос

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