skip to Main Content

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)?

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

2

Answers


  1. 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

    trash-restore

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

    How to Recover Deleted Files in Ubuntu Through TestDisk

    Login or Signup to reply.
  2. VS code actually fixed this and you can now un-delete a file while in an SSH remote session using CTRL + Z

    If you’re here cause you think you can’t do give it a try!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search