What does discard local changes mean?

Will Riley February 26, 2013

I often see this option "Discard local changes?"

Precisely, what does this do? Does this delete files in the .gitignore list?

1 answer

0 votes
KieranA
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.
February 28, 2013

Hi there,

Discard local changes will literally discard the changes you've made to the file since your last commit or pull, so make sure you use it carefully! Although I'm not sure where you're seeing this option, the diff view offers the "Discard" button. The option is typically called either 'revert' or 'reset' depending on DVCS you're using.

Cheers

ralvy August 18, 2018

You will see this in SourceTree 2.7.6 (Mercurial) for Mac when you have Uncommitted Changes in the tree, and then DoubleClick on the last Commit. If you check the "Discard Local Changes" in the ensuing dialog, you will be returned to the last Commit with no Uncommitted Changes, so all your changes since the last Commit are gone. Very convenient when you decide all the work you did since the last Commit should be trashed.

Like Akash Kumar likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events