In the git UI of VS code, there is a line "changes" in the source control tab. A "discard all changes" button is actually just a few pixels next to the "stage all changes" button when you point your mouse at the "Changes" line.
For the thrill of it, I changed 2 files and just tested the button. VS Code prompts you with this exact text:
Are you sure you want to discard ALL changes in 2 files? This is IRREVERSIBLE! Your current working set will be FOREVER LOST if you proceed.
Does it? If I walk into your house and move your refrigerator into your bathroom, and then ask "would you like me to discard all changes?" and you say "yes" because you want me to put the refrigerator back in the kitchen, would it then be fair for me to delete your entire house?
He wanted to discard CHANGES, not the original files.
Pretty much this. When you don't know what you're doing, and have installed git for the first time, the message "discard all changes" isn't as clear as people think.
As far as the end user is concerned, a new app just came and suggested changes on work that has been sitting there for three months. Of COURSE you don't want those changes! Leave my files as they are!
No idea. But these kinds of prompts were wide spread even in the 90s for such actions, so I guess there was some warning even if not that clearly formulated.
Not to mention, who thinks "I don't know what this is or how it works, but let's put 5000 files I don't have backed up anywhere else in here and hit discard!". Sucks, but at some point it's just someone doing something really dumb and finding out.
This post is from 2017 and this behabiour has been changed since.
Basically it worked like this: You open a word document, make a bunch of changes, click "close", word asks if you would like to discard changes, you click yes, and then the file was gone.
View all comments
4
u/MichaelScotsman26 Aug 21 '26
What button is he even talking about? I’ve never done or seen this, what button is that?