when a file is deleted from the disk, it is never really deleted, but simply the oprative system communicates to the disk that the space occupied by the deleted file is available.
then any other program that requires space can write in the first space occupied by the file. this also applies when the files are deleted from the trash.
this means that immediate recovery allows you to recover the entire file, which is immaculate and therefore as if nothing happened.
time-distance recovery, allows other programs to overwrite in whole or in part the data of the previous file.
ok to emotionally blame the uninstallation (which however never deletes files and folders created by the user, but only the files that the installation entered, otherwise they would serve the dinstallations), but this also means that the "important" file was important after a nice tot of time.. .
as Tristan said you experienced. from now on you will look where you put the work files, you will make a copy of each tot on an external disk, you will be careful about the uninstallations/installations.
think if (as it happens, it is not such a remote event) it physically broke the hard drive. You didn't lose the file. You lost all the files.