Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restore deleted files in visual studio code in the code management menu [duplicate]

I am really devastated because I have accidentally deleted 3 of my files in Visual Studio Code. I did it through the Source Code Management menu on the left side. Now my question... Is there any possibility to restore the 3 files I deleted like this? I would appreciate any answer and maybe you want to know: I use Windows :-( I tried to look into the recycle bin of windows but it isn't there. :-(


2 Answers

As of 2023

Open VSCode's command menu, and type "Local History" and select "Local History: Find Entry to Restore." Then type the name of the file you deleted.

This has worked for me when "undo" in the file tree has not.

Super easy, and has saved me from despair.

like image 60
Andrew Avatar answered Jan 22 '26 07:01

Andrew


vscode maintains a file-history using its latest TIMELINE view.

How to restore deleted git-untracked files in vscode:

Create the files with the same name at the same directory.

Go to TIMELINE on the File Explorer.

You can get the older versions of the files.

like image 38
Sumanth Lingappa Avatar answered Jan 22 '26 07:01

Sumanth Lingappa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!