Re: Undoing merges
"Richard" <richard@webdezign.co.uk> writes:
> Hi git list,
>
> I'm trying to find out how to undo a merge.
When sitting on a merge commit,
git reset --merge HEAD^
will undo this merge commit (i.e. pretend the merge has never occured, at least in your branch). Don't do that if you already published this merge commit.
> I know that my branches are independent and that I can just carry on
> working on them and merge again later, but I'm just trying to keep
> my revision graph tidier. Should I even be undoing merges?
If it's about cleaning up your history, "git rebase" is your friend, too (with the same limitation: don't do that on published history). By default, it does some kind of history flattening.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/