Undelete
Deleted files remain on disk until overwritten; possible to recover if you act quickly and know what you are doing.
When a file is deleted, the filesystem merely marks its directory entry as empty and the inode table entry as free—the data on disk usually remains intact until the OS writes something new there. Tools like `undelete` (DOS era), `testdisk`, and `photorec` scan free inode entries and attempt to reconstruct file metadata based on data blocks. The sooner you run the tool after deletion, the higher the chance. Modern SSDs with TRIM make recovery nearly impossible.
Recovery depends on the filesystem: ext4 with `secure_delete=1` guarantees that deleted bits are zeroed, while FAT32 merely marks them free. Tools on Linux: `extundelete` for ext*, `ntfsundelete` for NTFS, `photorec` for most formats.