Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Recently today, the power went out unexpectedly while i was editing one of my css files. after the power came back, i rushed to check if the file was ok but it wasn't :( it was corrupted, when opened in notepad it shows empty characters file size was not zero.

when i checked it in Komodo IDE, which i was using before the power shortage it was showing something weird i don't know how to describe it right, so i'm posting an image:

alt text

I wanted to know if there is any way i could recover my file :(

share|improve this question

migrated from Nov 6 '10 at 15:52

This question came from our site for professional and enthusiast programmers.

@ do you have one more copy in the source safe?? or in production – gov Nov 6 '10 at 15:50
Well, you're pretty f*cked up, it looks like your file is overwritten with NULL bytes. You could try recovery software like Recuva to get the deleted file back. – Lekensteyn Nov 6 '10 at 15:50
one more idea open the css in browser like firefox and see how the output is and probably you can save from there – gov Nov 6 '10 at 15:51
@Zubair1 What is the size of the file? – Šime Vidas Nov 6 '10 at 15:51
you don't do version control? using SVN, Git, or Mercurial... some editor I know save a backup copy of the file... not sure about yours... – 太極者無極而生 Nov 6 '10 at 15:54
up vote 2 down vote accepted

The only way to recover from your disaster is to restore from a backup. You will have to recreate all of the work you did since that backup. Sorry.

Many of the comments have mentioned using a version control system as a way to mitigate risks like corrupted files. You asked for a tutorial on version control systems. Mercurial has one. Check it out here.

Version control systems aren't foolproof. If its repository is also on the same computer you are working on, you run the risk of a disaster unless you have a backup. If the repository is on another computer, you still need to have a backup strategy for it.

Good luck.

share|improve this answer
thanks, yeah i guess i'll just have to move on.. and thanks for the TUT. – Zubair1 Nov 6 '10 at 17:28

Here's something that worked for me in a similar situation.

Firstly the file was on my LOCAL drive and I lost the contents due to power failure.

I deleted that file from my local folder, then installed Recuva (free software for undelete) and searched in that folder with Recuva. It was able to recover my file.

Hope this helps.

share|improve this answer
Thanks, your advice worked fine with me. you deserve (1+). – Lion King Mar 30 '14 at 0:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .