TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Developer accidentally deletes 3 months of work with Visual Studio Code

51 pointsby jacobralmost 8 years ago

25 comments

dansoalmost 8 years ago
The original Github issue seems to have been deleted, but here&#x27;s a fresher cache that includes a response from a VS Code Microsoft employee, including a pic of what the warning dialog looks like: <a href="http:&#x2F;&#x2F;archive.is&#x2F;EZX1O" rel="nofollow">http:&#x2F;&#x2F;archive.is&#x2F;EZX1O</a>
评论 #15044830 未加载
theknarfalmost 8 years ago
The sad part is that he didn&#x27;t learn his lesson. The problem obviously isn&#x27;t with Visual Studio Code, but with Git (or whatever version control software he tried out). It seems that he didn&#x27;t know anything about using git and accidentally checked out a bare repo instead of adding his files to stage. From his post, he says he&#x27;s using windows and he&#x27;s used to things going into the recycle bin, something a Linux tool like Git obviously isn&#x27;t going to do. So this is a mismatch between a beginner software developer on windows never having used Git before, and the mental model of Linux tools like Git.<p>I agree with him that Visual Studio Code could probably have designed their warning message a bit better, for people like him who have no experience with Git.<p>And now to the sad part, having accidentally deleted all his files while trying out Git; he will probably never touch Git again! So instead of learning the lesson he should have learned; always use version control on everything, what he did learn was; Git is harmful, don&#x27;t use it.<p>Of course it also kinda seems like he blames VS Code and doesn&#x27;t understand that it was the fault of Git, but that won&#x27;t make him start using Git anytime soon.<p>Learning about version control, especially Git, is the most important thing a software developer can learn as early as possible in his career.
评论 #15044526 未加载
评论 #15047430 未加载
评论 #15044584 未加载
评论 #15051844 未加载
评论 #15044557 未加载
sinxoveretothexalmost 8 years ago
I know nothing about Visual Studio Code and very little about anything VS in fact, so I have no idea how much is VS&#x27;s fault and how much is the user&#x27;s, but seriously, how on Earth is it possible to have 3 months of work not backed up or source controlled in any way?<p>I once had a nasty file system corruption due to disconnecting the power cord that corrupted my (local) git repo and almost made me lose a day of work. Even with source control there are risks.<p>If there is anything positive to take away from this,it should be to learn to consider risk management.<p>If you write code even, say, once every week and haven&#x27;t yet bothered to learn how to use source control, you owe it to your mental sanity to do it now.<p>EDIT: archived <a href="http:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20170818080940&#x2F;http:&#x2F;&#x2F;cc.bingj.com&#x2F;cache.aspx?d=1462716999241&amp;mkt=de-DE&amp;setlang=en-US&amp;w=xEsMxqoa0KJSwMsTh3p_8w2qryykfDvB" rel="nofollow">http:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20170818080940&#x2F;http:&#x2F;&#x2F;cc.bingj.co...</a>
ogrimalmost 8 years ago
I never trust anything but the commandline when it comes to git. Then I know full and well what I&#x27;m doing regardless of the editor. When there are too many icons and buttons to click I don&#x27;t like to have to remember what they all mean, or how well they map to the underlying core git concepts.
评论 #15044734 未加载
评论 #15044569 未加载
评论 #15047044 未加载
Grue3almost 8 years ago
This is a valid complaint. You simply don&#x27;t design UI that allows to delete a large number of files with a press of a single button. That he didn&#x27;t have backups is irrelevant. Even accidentally deleting fresh changes is quite damaging. VS Code doesn&#x27;t say anything about Git, or what Git is. You can&#x27;t expect anyone who downloads MS software to be a Git expert.
评论 #15044852 未加载
评论 #15054264 未加载
nikki-9696almost 8 years ago
It may be victim blaming, but having 3 months of work and it only exists on one hard drive on one computer isn&#x27;t very bright. He learned the hard way. I mean honestly, disk drives fail. PCs break. The code should never be in only one place regardless. Also, coming from VSS to Git has been, and still is, one of the hardest things I do as a windows dev. I hate git. It is non-intuitive and I have accidentally deleted my work before also, the difference being that I have it stored else where to get it too.
NicoJuicyalmost 8 years ago
So, his hard drive could die. He could have a virus or a crypto infection. All would delete his work.<p>A developer uses source control, it&#x27;s as easy as that.
评论 #15044929 未加载
评论 #15044496 未加载
xeo84almost 8 years ago
No source control, no backups and you &quot;play&quot; with a new software to see how it handles 5000 files? Well... not sure what to say here..
chrisbennetalmost 8 years ago
As a product developer, when a user of my software &quot;makes a mistake&quot; my first response is to ask myself &quot;What could <i>I</i> have done to avoid the user making this mistake?&quot;<p>As Jeff Attwood says:<p>&quot;a well-designed system makes it easy to do the right things and annoying (but not impossible) to do the wrong things.&quot;<p><a href="https:&#x2F;&#x2F;blog.codinghorror.com&#x2F;falling-into-the-pit-of-success&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.codinghorror.com&#x2F;falling-into-the-pit-of-succes...</a>
tym0almost 8 years ago
He says that it wasn&#x27;t in a repo, so it&#x27;s a bit weird that it would delete all his files, it looks more like he had an initialised repo and hadn&#x27;t committed the files yet.<p>I don&#x27;t even know how you could work 3 months without committing, even working on a throwaway thing for more than a few hours I make a new local repo, it doesn&#x27;t cost much.<p>Also the files are not gone, they are still on the hard-drive&#x2F;SSD it&#x27;s not that hard to look up file recovery software.
评论 #15044503 未加载
评论 #15044541 未加载
评论 #15044751 未加载
antigirlalmost 8 years ago
He deleted his profile, rightly so - thats no way to act on github, open forum for pretty much every web developer out there. Not making a good name for yourself
arnioxuxalmost 8 years ago
I predict one day we will look back and be horrified that there was ever a time where you can&#x27;t just roll back an entire system to an arbitrary timestamp to undo accidental changes.<p>In some sense this is already achievable if you just always work inside a Dropbox folder (which keeps a 30 day history of any synced changes). But resources aren&#x27;t yet cheap enough for all changes to be immutable.
评论 #15044648 未加载
评论 #15044737 未加载
lonnie_jonesalmost 8 years ago
His story is a little funny and a little sad. I had a similar experience but I was much more cautious. I had actually backed up my project through GitHub desktop and committed it before formatting my computer. After cleaning and setting the system back up, I lost a days worth of work. I was 100% sure I had committed it. When I started back where I was and committed my changes, I checked the web Github to ensure that the changes were still submitted and they weren&#x27;t. There was a bug with Windows 10 and Github that caused it. After that I decided to use Google Drive to backup my Github upon changes. Don&#x27;t try to use Github folders and Google Drive folders as the same directories. Something weird happens and only one will work. Now I make submissions to Github and have a duplicate folder (using relative paths in my project) in my Google drive. Alternatively, you can submit your changes through the Github website, but it takes forever.
gjvcalmost 8 years ago
I learned about &quot;git checkout .&quot; the hard way once, too. Only lost three hours then, though.
blueprintalmost 8 years ago
But, for real, 3 months of work and not a single backup?
WeedRamenalmost 8 years ago
Really feel for the guy. Hasn&#x27;t happened to me, but I would hope a developer friendly editor would give warnings about when something like this could happen. Does VS Code have a tutorial? Haven&#x27;t used it before, can&#x27;t say I am inclined to right now...
评论 #15046443 未加载
stillsutalmost 8 years ago
&quot;This is Git. It tracks collaborative work on projects through a beautiful distributed graph theory tree model.<p>Cool. How do we use it?<p>No idea. Just memorize these shell commands and type them to sync up. <i>If you get errors, save your work elsewhere</i>, delete the project, and download a fresh copy.&quot;<p>- <a href="https:&#x2F;&#x2F;xkcd.com&#x2F;1597&#x2F;" rel="nofollow">https:&#x2F;&#x2F;xkcd.com&#x2F;1597&#x2F;</a><p>I think MS would do well to just buy this comic from Randall Munroe and display it on git init. In 10 seconds you get a more useful and realistic appraisal of the tool than you will from reading the docs for an hour. You heard me right: Docs by Meme.
eklavyaalmost 8 years ago
I have seen people learn to source control the hard way multiple times, but usually they were saved (at least partially) by the local history feature in IDEs. This guy was hit very hard, I feel sorry for him.
styflealmost 8 years ago
This got &quot;fixed&quot; in #32459<p><a href="https:&#x2F;&#x2F;github.com&#x2F;Microsoft&#x2F;vscode&#x2F;issues&#x2F;32459" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Microsoft&#x2F;vscode&#x2F;issues&#x2F;32459</a>
mastefalmost 8 years ago
Pro-tip : you can keep your little projects in a Dropbox folder. Will keep track of your file changes automatically and can help restore deleted files &#x2F; or restore them to earlier versions.
dovdovdovalmost 8 years ago
Haha, SourceTree can also do that! Fun times!<p>Source control responsibly people! :)
评论 #15044573 未加载
devrandomguyalmost 8 years ago
Streisand effect is taking off: <a href="https:&#x2F;&#x2F;github.com&#x2F;Microsoft&#x2F;vscode&#x2F;issues&#x2F;32795" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Microsoft&#x2F;vscode&#x2F;issues&#x2F;32795</a>
mcheung610almost 8 years ago
This is like someone is trying to learn how to cook the first time and burned the house down. Instead of blaming himself, he blame the stove and fire.
whipoodlealmost 8 years ago
Well, that&#x27;s not very positive... but I can relate. VS Code lost some work of mine on the first day I tried it, so I decided not to continue using it. It wasn&#x27;t super important so I wasn&#x27;t angry, but it was a good chunk of code I had just spent probably 45 minutes writing and debugging.<p>You could argue it was my fault because I didn&#x27;t stage and commit the new file, but there&#x27;s no reason to close a buffer just because the backing file is gone. Close it if I say so, otherwise keep it open with the last-seen contents of the file. This has always worked fine in Sublime.<p>Please always err on the side of not losing data, even if it means keeping around &quot;annoying&quot; extra tabs.
评论 #15048967 未加载
评论 #15062442 未加载
Quarrelsomealmost 8 years ago
its always sad to see people learn the lesson of source control the hard way.
评论 #15046451 未加载