Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you revert with sourcetree?

Tags:

git

sourcetree

What is the process to revert back to a previous commit if you are using sourcetree? Please no command line help, I understand how you would achieve the same result there but am specifically looking to do it with my friendly atlassian tool.

like image 277
AMAN77 Avatar asked Apr 01 '16 11:04

AMAN77


1 Answers

What exactly do you mean by revert?

You can commit a reverse commit by rightclicking on a commit and selecting Reverse commit. This will effectively create a new commit that negates the changes you made in your selected commit. The commit with the changes you negated will still exist.

You can checkout an earlier commit by doubleclicking on an earlier commit or rightclicking and selecting checkout. This will change your code to the state it was for your selected commit, so without the changes from later commits. The commit with the changes you negated will still exist.

You can reset to an earlier commit. This will remove the commit with the changes you want to negate. (They can normally still be recovered using the reflog)

like image 60
miva2 Avatar answered Sep 30 '22 16:09

miva2