Tip for MacOS users: since MacOS High Sierra, you can undelete files using local snapshots using Time Machine app (APFS formatting on High Sierra allows this)

An interesting side effect of APFS formatting of hard drives on macs (required since MacOS High Sierra) is that APFS keeps local snapshots (which is why right-click on MacintoshHD shows disk space many gigabytes as “purgeable”).
The impact of this is that if you delete a file – and also perma-delete from Trash – **you can still recover it from Time Machine backup (but from local snapshot of it) – even though you may not have done a real Time Machine backup of that file to external backup drive for months!**
So if you delete a file, run Time Machine even without external backup drive plugged in – and will find previous snapshots – which seem to be hourly snapshots for last few hours.
View Reddit by stereomatch – View Source