discard multiple files in SourceTree

Is there a way to discard multiple files at once in SourceTree? Sorry if this is obvious but I've been looking all over the place and the only place to discard is on the diff panel on the right, which only discard one files even if multiple files are selected.

3 answers

1 accepted

6 votes
Accepted answer

This is a terminology issue - in the toolbar and on the right-click menus the operation is called 'Revert' in Mercurial, and 'Reset' in Git. You can use the toolbar button of this name, or multi-select files and right-click them to get the operation for that set.

'Discard' was used in the diff view because the action didn't map exactly to these Git/Mercurial commands, since it could do hunks and lines too. It's not ideal to have similar outcomes called different things though, I might get rid of Revert/Reset and rename them to Discard too for clarity, even though Discard isn't actually a git/hg command name.

Steve,

I also found this confusing. May I suggest renaming to Discard? In Git, "Reset" isn't really the right term, either, because two Git commands are actually used: reset and checkout. So if using the underlying SCM term was the motivation, that mark wasn't really hit.

Note that for new files, 'reset' is not option. You need to select new files separately and select 'remove'.

Steve,

I also found this confusing. May I suggest renaming to Discard? In Git, "Reset" isn't really the right term, either, because two Git commands are actually used: reset and checkout. So if using the underlying SCM term was the motivation, that mark wasn't really hit.

You can batch select and discard in windows,  just not on mac sourcetree.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

832 views 3 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you