Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I revert a merge commit in sourcetree


I work using pull requests and sometimes they need to be reverted. The command line workflow I use is as documented here:

Basically I create a new branch, find the merge commit SHA and then run

git revert -m 1 SHA

In sourcetree there is the 'Reverse commit...' option, which does a git revert but it will not work on a merge commit because it will not use '-m' (see

How can I use sourcetree to revert a merge commit?


1 answer

1 accepted

0 votes
Answer accepted

If you want to do it in SourceTree, you can only do it with a custom action.

I already created a feature request for this, you can vote for it here.

Zero reference for the command to enter into the custom action to actually answer the question?

Script to run:



revert -n -m 1 $SHA

(I prefer it not to automatically commit so I can review the changes, hence the -n parameter)

Like # people like this

Thanks it was helpful for me

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

7,045 views 5 13
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you