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
Published yesterday in Agile

How Scrum works? It starts with training and education

To answer “How scrum works,” most of the teams I've worked with first addressed the question: “where to start?”  That question applies to both implementation and improvements on the Scrum framew...

118 views 3 3
Read article

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