Hey there! Let me share a crazy experience I had recently. I was working on a lengthy piece of code in a new file in VSCode. After spending hours p...
For further actions, you may consider blocking this person and/or reporting abuse
I created an account just to thank you.
I had an assignment with a controller file with over 500 lines of code, and I was helping my professor debug a PHP setup error and forgot to rename the dummy file. All my code was gone, I was devastated, went through total shock.
You saved my assignment, my time, and my mental health. Thank you for writing this, for sharing this. I wish the utter best for you.
I'm happy it worked for you! ๐
It also works if you worked on a remote server. You opened files through Winscp, you edited them in VS Code (it opened and saved them in a temp directory). If something nasty happened on the server and you overwrote a file, you can recover it with the method here. Thanks Krzysztof!
Wow. Awesome you're sharing it! Thanks for info!
It's May 6, 2025, 12:30 AM. I got lost in the commands in Git Bash and accidentally removed my files. I couldn't even see them after relogging. I panicked and cried a little โ I worked on this the whole day just for it to disappear. But I searched for a solution, and it worked! I have a project presentation at 2 PM, haha. Thanks you sir!
i was very panic because mistakenly some important file overwritten in vs code. so that i had lost all important code from vs code file then after i searched many platform but did not find solution. then after long time i found write solution to retrieve our overwrite file/code. Now i have restored code so i fell very happy. thank you. live long
Happy to hear it helped! I can feel for you.
PS. If only you want, feel free to buy me a coffee ๐ buymeacoffee.com/krisplatis
Ive almost pooped a brick when .git ate up 6 months of hard work by replacing master with an ancient repo... I screamed , i cussed, broke stuff and had a hissy fit just to vent, but ai suggested that there were file caches for visual studio, one Google search later and im here... MANY MANY MANY MANY THANKS :3 ... also thanks Microsoft for Visual Studio, have I coded with nano the "1337" way I woudlnt have backups
I have lost of all my files. It got Permanently deleted. Unable to recover from anywhere.
Finally able to recover all files because of this post.
Thanks to you and also to my brother Arvind who pointed out this post.
Thanks to VS code team too.
Thanks Krzysztof! Your post was a life saver!
I was moving a file from one directory/folder to another within the Solution Explorer view of VS Code, and my file completely disappeared without a trace. No history of it via MS Windows functions or commands (e.g. FileExplorer, Command prompt). It had just vanished! I'm not sure if this is a known bug in VS Code or not, or if anyone else had run across this issue!
Anyway, the file had not been committed to my github repository, yet, and I was very panicked to say the least. So I thought I would do a quick "Google" search, which I am glad I did, as it brought up your post!
After following your instructions, my file was restored!
Thank you! Thank you! Thank you!
Brother you saved my life I had weeks of work lost and thanks to this i recovered it, I couldnt believe it at first. I sincerely wish God always be with you and that everything in life will go the way you want it to.
I created an account just to thank you!
I'd been working on a project for about a week when I broke it with the wrong Git command. All my changes reset to the last commit. I panicked, almost died, couldn't sleep all night, and felt a pain in my body like a breakup. At 5 AM, I realized there must be some history beyond Git's.
Thanks a lot!
And thanks to the VS Code developers for including that feature. By the way, it could be improved, as well as git history as it can accidentally reset unstaged changes.
Nice to see comments from people who've rescued their life's work.
Saw someone said you can just open the recycle bin and restore.
However, if your pc decided to crash during a file save on a hard drive failure, causing an empty file on reboot.
This has to be the only solution. Thank you.
It's May 6, 2025, 12:30 AM. I got lost in the commands in Git Bash and accidentally removed my files. I couldn't even see them after relogging. I panicked and cried a little
I worked on this the whole day just for it to disappear. But I searched for a solution, and it worked! I have a project presentation at 2 PM, haha. Thanks you sir!
Amazing it works perfectly thanks for info.
You just saved my life. Thanks
I accidentally did a git checkout but forgot to commit, all the files were replaced by the old version. Local History helped me restore everything! Thank you!
you could have just opened the trash bin and restored :) but yes this is easier
Good idea. I've tried it too, but the file wasn't in the trash. Likely, because I've accidentally removed it with some git command (but not regular "delete file" action in the system).
Thank you, you just saved my 2 weeks of work!
I just can say... you saved me a day of work.
Thank you , you saved my life
thanks :")
I just wanted to say a huge thank you for your post. I messed up my project and thought I lost everything, but your solution saved me! I canโt tell you how relieved I am.
thanks Krzysztof! ๐๐
Thanks for sharing your feelings! I can totally feel for you and could feel the same... twice ๐ - it happened to me once again a few months later after sharing this blogpost that I deleted my files once again ๐)
By the way, just in case you'd like share your joy in other ways too, you might want to buy me a coffee: buymeacoffee.com/krisplatis ๐
thanks bro
This is amazing, just had a guy on Discord shared this to me
Thank you both!
Thank you for the save ๐
You save my day โฅ
WOW THANK YOU!
Your post helped me rescue a co-worker from a serious jam.
Even now, it's unclear how the original files were lost, but the vscode cache was able to bring them back.
thanks bro you saved me
Happy to hear it helped! ๐
Feel free to buy me a coffee if you want ๐ buymeacoffee.com/krisplatis
*Your article saves my day too *
Thanks a lot, it really helpful
thanks.
wow!! work thank u so much !! me too, I created an account just to thank you
I'm so happy it helped you! ๐
You're a superhero, you just saved me from depression ๐ค .
Thank you, you save my time <3 :)
hhhh life saver I was about to go crazy
You are my hero! Thanks for the artical! It was really helpful!
I asked AI to rename some of my files with code, so he created new files and removed old, but didn't apply my latest changes, I was added during the day. Asked to restore but no luck.
So the VS code file history help me a lot!
I created an account you to say:
THANK YOU! I had been working on a script like for 5 hours!
Happy to hear you saved your hard work! ๐