What exactly is "Reverse commit..."

Hi,

Please can you tell me the exact git commands that will be run when I select a commit or merge, then right-click (or ctrl-click) and choose "Reverse commit..."?

Thanks

2 answers

This widget could not be displayed.

You can find this out for yourself. Do the reverse commit and select the "show full output" checkbox in the progress window. (Don't push it to any remotes)

If you decide you don't like the reversed commit, you can reset your current branch to the previous commit.

This widget could not be displayed.

Hi,

I couldn't actually see the 'show full output' checkbox or the progress window (maybe because I'm on a mac?) however I can view the command output. Here is what I got:

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree revert --no-edit 71a12878a65fd5c0f557dbec0395645cbee21042

I suppose that can be simplified to:

git revert SHA1

It's worth saying that it doesn't automatically add '-m' when you try to reverse a merge commit, so that will fail:

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree revert --no-edit 8c463e3bf87d92897099b4e4f1473a19490e9294 
error: Commit 8c463e3bf87d92897099b4e4f1473a19490e9294 is a merge but no -m option was given.
fatal: revert failed





Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in Canada

AUG Lunch Roundtable - August 13 - Highlights

Thanks to everyone who came out today for the lunch AUG - we had some great food and discussion (and ice cream sandwiches to fend off the heat!) The welcome and fun fact was great as well, what an aw...

37 views 2 3
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