From: Jeff King Date: Fri, 26 Oct 2007 16:49:26 GMT Subject: Re: How to remove a specific hunk Message-ID: <20071026164926.GA21160@coredump.intra.peff.net> In-Reply-To: <20071026164207.GB19673@coredump.intra.peff.net> On Fri, Oct 26, 2007 at 12:42:08PM -0400, Jeff King wrote: > That has the side effect of changing the index state. My preferred > method would be to just excise the hunk from the diff using an editor > (and this actually has nothing to do with git; you could be using > diff/patch): > > git-diff file >patch > # remove every hunk except what you want to cut out > $EDITOR patch > git-apply -R patch BTW, since this is inherently a non-git operation, there are other tools that some may find friendlier than an editor. Kompare will let you unapply differences, for example, and I would be shocked if emacs didn't have some tool for this. -Peff