How to recover from bad merge

I am using SourceTree to manage a BitBucket Git repository. I did a merge a couple weeks ago, but I must have goofed it up. I do not see any of the changes from the merged branch in master. When I try to merge the branch again, no changes are getting merged. I have made multiple commits in the master branch since this merge. How can I redo this merge without losing the work done in the subsequent commits.

3 answers

I'm not sure we can tell you how to fix it without a more specific idea of what went wrong. Did one of the subsequent commits somehow revert your changes?

None of the subsequent commits refer the files that should have been merged. What is also odd is that the commit created by the merge does not include any of the files that I would expect to find.

You might try creating a branch off of master on the commit prior to the original (faulty) merge, then merge from your other branch into this new one, and see what that branch looks like after the merge.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Featured Groups

Tuesday tips & tricks: What is the Atlassian Community?

It's officially Tuesday, which means it's officially time for another tip to help you better navigate this space we call the Atlassian Community. 😄 I got a great question from community member, Sa...

120 views 6 8
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you