The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How do I undo a change that was committed locally and pushed to the server?

Richard Wooley
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!
October 16, 2015

I performed a manual merge recently.  The merge was committed and pushed to the server, but now we've found a major problem with it.  (The problem file is the storyboard and manually undo-ing the changes will not be trivial.)

Is there a simple way to undo the change on the server and then pull the clean code back to my machine?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
October 16, 2015

The safest way to do this is to right-click the bad commit, and choose "reverse commit". This will create a new commit that performs the opposite changes compared to the one you selected to reverse.

Commit the reversed changes (if SourceTree doesn't commit automatically), and push to the remote.

Git also allows you to re-write the history to remove that commit from the branch entirely, but this is generally considered bad practice because it can cause problems for the local repositories of other team members.

TAGS
AUG Leaders

Atlassian Community Events