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

In SourceTree, how to go back to previous commit and delete new files?

Justin Pierce December 16, 2013

So before I upgraded a third party plugin in my project to their newest version, I did a commit so I could reverse the changes if things went haywire. Well, things went haywire and I'd like to restore the project to the state it was at with the last commit. I tried 'Reset master to this commit' but it seems to have kept some of the new files added when I upgraded the plugin even though I selected hard (discard local changes). There's many files, so manually deleting the problem files would be tiresome (why I made sure to commit before upgrading).

Anything I can do in SourceTree?

edit: does removing files in SourceTree delete them?

2 answers

0 votes
Aseem Parikh
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 Leaders.
December 17, 2013

Try the "stash" feature. Stashing (untracked files must be staged when using sourcetree, I believe) will leave you with a clean working copy up to your last commit. If you decide you want your changes back, you only need to apply the stash. If you want to discard your changes, you can just drop/delete the stash.

0 votes
Justin Pierce December 16, 2013

So I was able to browse Uncommitted Changes and delete the files that had been added. Seems to have solved my problem, but I'll still give credit for the answer if someone provides a cleaner solution.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events