Hi, I had a file called "ap.js" and I replaced it with another file called "ap.js". Is there any way to get the old file back?
You can use Recuva, I have used that software in the past to recover deleted files, just make sure you stop any download you may have as for the most part once you delete a file you are not really deleting that file but marking that space as being freely available to the OS which could eventually use it if new space is required on the hard drive.
Since you only replaced the file and you did not safely deleted it then the recovery should in theory come with no problem.