When working with GUIs on a Linux machine, the files/directories that are deleted usually land up in the trash directory, which is generally under ~/.Trash or ~/.local/share/Trash. So, in case of accidental deletions, we know what place to cd to.

On shells, the rm utility is what most of us would use, and with regard to data recovery, the man page states that:

If you use rm to remove a file, it might be possible to recover some of its contents, given sufficient expertise and/or time.

This may be an exercise for another day to try retrieving the removed data (as rm does not destroy the file data but simply unlinks the reference; if done in a timely manner, it may end up working). But we can conclude that data recovery here would be a rather non-trivial and tricky process.

So, we would want to safeguard against accidental deletions. For that, we could use the trash-cli package. That way, the files that are removed will be moved to the trash directory, and the data retrieval will be just a command away.