Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Remove Pushed File from Branch

Gregory Spicer July 19, 2017

Hello,

I recently accidentally push .gitignore into my branch, but didn't want to even commit it. After floundering for a while and running a lot of sourcetree functions to try to change where my origin is, I'm still not able to reset the orgin to a version that doesn't have .gitignore pushed. I've made a pull request already to merge this branch into master, and I'm not sure if that affects how I can change the branch here. Here's a photo of what my status looks like, I'd like the origin to be reset where the bugfix is.

Screen Shot 2017-07-19 at 9.36.26 AM.png

1 answer

1 accepted

0 votes
Answer accepted
Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 20, 2017

You can "Reverse" your commit and get all your changes reverted to as it were on the previous version. 

Right click on the commit row to select "Reverse commit".

Reverse.png

Gregory Spicer July 20, 2017

I wasn't able to do that before because I had a pull request open and a merge was in progress regarding that commit. Once I closed the pull request I was able to reverse the commit.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events