Git reset –merge

Or how to reset a merge commit?

If just after a merge commit you recognized that it was actually “git rebase” that you wanted to do, then your friend is:

git reset –merge 14c1d90c3e

where the target commit is the one preceding the merge.

But when reset is not an option?

But if you found the faulty merge after several other commits (or after pushing to remotes), resetting is not so good idea or won’t work at all. In that case refer to How to Revert Faulty Merge in the HowTo.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s