Forums

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

Reverse Commit in Sourcetree

Ru1 85
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 10, 2024

I want to reverse the commit to the 3rd one named "Edit" in Sourcetree.

But one thing, is it best to have a separate branch for the test site and the main site? As I realized it when I have a different code for test site in vs code and now I can't edit my main site because it is my test site code.

If I need to change it, I want to reverse the commit to Edit Map" so "Edit Layout" would be gone. But I still want the Layout files to be kept for a different branch.

How do you do it/ I tried reverse commit and it made another random commit to "reverse" the changes and reset current branch (hard) but that method just tell me to pull and then I get the files back.

I need the help!
Thanks!

Screenshot 2024-04-10 164103.png

1 answer

0 votes
Brant Schroeder
Community Champion
February 5, 2026

@Ru1 85 Welcome to the Atlassian community

Reverting a commit in SourceTree (GUI for Git) can mean two different things: creating a new commit that undoes a previous commit (safe, non-destructive), or resetting the branch to remove commits (destructive for history). Below are clear steps for both approaches, plus notes about when to use each.

How to reset - https://support.atlassian.com/sourcetree/kb/reset-branch-to-a-commit/  

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events