threads / discuss / 24951

How to "revert hunk" in git gui?

Subject: How to "revert hunk" in git gui?

## tl;dr

One message between Sep 2, 2010 and Sep 2, 2010.

replies: 0people: 1as markdown or json

Stefan Haller· Sep 2, 2010, 18:59 UTC · lore

I always use git gui to make commits, and I like the way you can stage and unstage hunks easily.

Often, when looking at the unstaged changes I come across some piece of debug code that I forgot to delete, and I can't seem to find an easy way to revert this hunk. As a workaround, I can stage the entire file, unstage the hunk I want to revert, and then choose "Revert changes" from the Commit menu (which reverts just the unstaged hunks); but that's a bit inconvenient.

I feel that this is such a common operation that I must be missing something.

Thanks,
   Stefan
-- 
Stefan Haller
Berlin, Germany
http://www.haller-berlin.de/

← back to recent threads