From: Junio C Hamano Date: Fri, 11 Dec 2009 00:04:28 GMT Subject: Re: How to selectively recreate merge state? Message-ID: <7v8wda8jg3.fsf@alter.siamese.dyndns.org> In-Reply-To: <76718490912101556o3e2911e8t32b48c0b735fd98c@mail.gmail.com> Jay Soffian writes: > Let's say you initiate a merge: > > $ git merge topic > > And this merge results in conflicts in two files, foo and bar. You > resolve the conflicts in both files, but then decide you don't like > how you resolved bar. > > How do you set the index and working-copy back to the state it was > immediately after doing the merge for bar, while leaving the merge > resolution alone for foo? Before you "git add bar", you can say "git checkout --conflict=merge bar" (or --conflict=diff3). After "git add bar", you can't. Save what you have resolved so far in a separate file (e.g. "cp foo foo.resolved"), reset to the previous state and redo the merge.