From: Olivier Ramonat Date: Fri, 26 Oct 2007 21:59:45 GMT Subject: Re: How to remove a specific hunk Message-ID: <87prz1a65q.fsf@tah.ramonat.fr> In-Reply-To: <47220A05.4040705@wanadoo.fr> Pascal, Pascal Obry writes: > Andreas, > >> Once you've added the other two hunks, they'll no longer show up in >> git-diff, so you can do something like this: >> >> $ git-add -i; # add the other two hunks to commit >> $ git-diff > middle-hunk.patch >> $ git-apply -R middle-hunk.patch >> test, test, test >> $ git-apply middle-hunk.patch > > Thanks, this will clearly work. I was expecting something more > integrated like a "git reset --interactive" or something like that :) A solution could be : git add -i --> Add the two "good" hunks git checkout-index file_with_bad_hunk --> Remove the "bad" hunk by getting the staged version And then git reset HEAD file_with_bad_hunk if you want to unstage it. Olivier