Accidentally delete file in visual studio code with remote ssh


I used ubuntu and ssh by shh-remote extension to another ubuntu server, and I accidentally deleted a folder containing important files by pressing the delete key. I pressed "ctrl+z" but it did not restore.
What did vsc actually do?
How did I recover the deleted files (either by Visual Studio Code or by another way)?

I use testdisk to recover but it show "ok" quite low, and "failed" quite high?
Many thanks.


You cannot recover files you have deleted with SSH through the VSCode editor built-in properties like Ctrl-Z. Operations on the disk are the responsibility of the operating system.

If you have not GUI acces to OS maybe you can look at the

ls /home/$USER/.local/share/Trash

or if your files deleted with root privileges

ls /root/.local/share/Trash

If your files are not deleted permanently you can restore with Trash-CLI program:

sudo apt install trash-cli

then put this command to terminal


If your files deleted permanently check this link for file recovery:

How to Recover Deleted Files in Ubuntu Through TestDisk

Answered By – Dogukan Aydin

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published