Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

New version broke the "Reverse Commit..." feature.

Teagan Strauss
September 12, 2024

Before upgrading to the newest version, we used to be able to right-click a commit and select "Reverse Commit..." in order to run a `git revert` on that commit.

Now, it gives this error:

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks revert --no-edit -m 1 {SHA}

error: mainline was specified but commit {SHA} is not a merge.

fatal: revert failed

Completed with errors, see above.

Note that we do not use merges. I was just trying to revert a commit, I have no idea why it would specify -m. This used to work fine on a previous version of SourceTree.

1 answer

0 votes
Brant Schroeder
Community Champion
January 11, 2026

@Teagan Strauss By default git revert refuses to revert a merge commit as what that actually means is ambiguous. I presume that your HEAD is in fact a merge commit. If you want to revert the merge commit, you have to specify which parent of the merge you want to consider to be the main trunk, i.e. what you want to revert to.

Teagan Strauss
January 12, 2026

 

See above:
> Note that we do not use merges. I was just trying to revert a commit, I have no idea why it would specify -m. This used to work fine on a previous version of SourceTree.


I presume that your HEAD is in fact a merge commit.
Nope. We use fast-forward-only. There are no merge commits. Just trying to revert a regular, non-merge commit.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events