I was editing a files in Notepad++ which I saved. Unfortunately I did not close Notepad++ application and PC was powered down due to out of battery. When the power was back on,
Install Recuva. In Recuva Wizard select the folder where the corrupted file is. When it first searches for files, it finds only deleted ones. When the search is over, press "Switch to advanced mode", then "Options". Go to Actions tab, select "Scan for non-deleted files", press OK. Then press "Scan". If you are lucky, you will see your file in the list and will be able to recover it.
Hope it helps. I recovered a style.css file this way.