Restore overwritten file

I saved a file I was working on with the name of a different project I was also working on. Now I have two different projects with different names but all the same content. I’m afraid to open and check files that were saved elsewhere because I don’t know what’s going to happen. Can you advise on how to proceed to restore the file that was overwritten?