Developer Accidentally Deletes Three-Month of Work With Visual Studio Code (bingj.com)
New submitter joshtops writes: A developer accidentally three-month of his work. In a post, he described his experience, "I had just downloaded VScode as an alternative and I was just playing with the source control option, seeing how it wanted to stage -- five thousand files -- I clicked discard... AND IT DELETED ALL MY FILES, ALL OF THEM, PERMANENTLY! How the f*uk is this s*it possible, who the hell is the d******* who made the option to permanently delete all the files on a project by accident even possible? Cannot even find them in the Recycle Bin!!!! I didn't even thought that was possible on Windows!!! F*ck this f*cking editor and f*ck whoever implemented this option. I wish you the worst.'
Fortunately he can just retrieve his files from his Git repository, right? Or... he just learned a painful lesson of why you always use a code repository.
This isn't about backups, it is about not having a central repository. It isn't enough to have revision control, you have to actually be checking it in to a repository and sharing code. Even if you're only sharing with yourself, you still want your revision control to work well. And if you're not synchronizing anything, then you're not even getting feedback about if the system is working.
It isn't enough to commit the code, you also have to push it somewhere. Even if that is just a repo on the same box.
You don't want to restore this situation from backups, you want the restore to be from the repo. Much simpler and more to the point. And the backup would be of the repo, not the working directory!
A single copy on Dropbox that has no SLA with you... is not sufficient.
... one). (offsite cloud backup).
You can setup a free account for a private repository on Bitbucket (free for small teams of
You should also be doing regular local backups and rotating them at a friends house as well (3 copies minimum).
So just for fun, I tried it.
Did he happen to ignore the popup with the big yellow exclamation mark that says:
"Are you sure you want to discard ALL changes? This is IRREVERSIBLE!"
At the very least the ALL CAPS WITH EXCLAMATION MARK! should have possibly made him think "Hmmm...this seems to be a pretty important question"
But apparently he decided: "Ah, screw it. It's only 3 months of my life".
Given that level of skill, I can't think much of importance was lost.
I'll agree that the language could be clearer, but it does show this popup when you try doing this right now. That should be a hint that something bad might happen, I'd say.
Totally this! I've been coding for some 20 years now or so. Even for small personal projects, they go into a managed repository. I lost about a week's worth of code in my youth, then I learned about Microsoft Visual SourceSafe, their local repository system. Then I transitioned that over to Source Offsite, a networked version of SourceSafe. This progression then moved through the ranks of CVS, SVN, and now to GIT. Having version control has so many benefits for even single devs, like diffing revision history. "How did I fuck myself up? Oh yeah, I can just check my commit history!" - This has saved my ass countless times.
It was ALL PENDING CHANGES.
He never did any commits!
Dewey, what part of this looks like authorities should be involved?