Delete the file that is causing the problem ( the one that you can't revert ) from your disk. now you should find both versions of the same file marked as being deleted.
Commit the deletion of the files.
Create the file again with the same name and paste in the correct code you have copied in step 1