You can potentially undelete files/folders on ext3 or ext4 filesystems.
If you accidentally rm your folder of pictures/whatever then its best to
immediately stop and unmount that partition to prevent inodes/data
associated to that data potentially being overwritten that will void
being able to restore the files/folder.

Change directory to /root, or mount and change directory to another
partition other than the one from which files/folders are to be
recovered.

Ensure the ext3 or ext4 partition that is to have deleted file/folder
recovered from is unmounted.

To undelete a specific file, you will need to know the full path and
filename of the deleted file.
Execute the command like this:

extundelete /dev/sdaX --restore-file path/to/the/deleted/file

You can also do something similar to recover a deleted folder
(directory).
Execute the command like this:

extundelete /dev/sdaX --restore-directory path/to/the/folder

If you don't know or remember the entire path and filename, you can
restore all of the deleted files on the drive volume.
Execute the command like this:

extundelete /dev/sdaX --restore-all

All recovered files will be saved to a folder named RECOVERED_FILES/,
unless you specify a different folder with the -o option, followed by
the path to the folder.
