Search code examples
gitatlassian-sourcetreegit-stash

Unmerge the branch from Git with sourcetree


How do i remove the purple merge that was highlighted in source tree?

I accidentally merged my branch to master and many devs committed on top of that, now I have to undo my merge from master but not delete it.

Git flow


Solution

  • You can actually revert a merge.

    Here is an explanation of different possible ways: https://git-scm.com/blog/2010/03/02/undoing-merges.html

    There is also the hard way: doing an interactive rebase https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History and stripping the unwanted merge commit. But probably, since you are asking this question in the first place, you should not walk this path.