Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notepad++ crashed and overwrote file with empty version

Tags:

notepad++

I come with an all-too-familiar tale that really comes down to me not backing up frequently enough and suffering the consequences of that. Anyway, maybe someone can offer me some help, so here goes ...

I was working on a CSS file in Notepad++ (6.9.2), when the program suddenly crashed. Upon reopening the program, I found that it had emptied my file and saved this empty file, overwriting my original file. So, now I cannot recover my CSS file. I have checked in the User/AppData/Roaming/Notepad++/backup folder; however, the lost file is not one of the ones listed there.

There is also a crashdump file that coincides with the time of this crash, but I am not sure whether that could be of any help in recovering the file.

I am hoping that there is some way to recover this file - even if it is a somewhat earlier version of it. I assume that I'm out of luck here, but thought that I'd ask anyway.

like image 420
JCM Avatar asked Dec 14 '22 04:12

JCM


1 Answers

If it's not in %AppData%/Notepad++/backup you may be SOL. You could try using a deleted file recovery tool, cross your fingers, and hope some old version of it is buried somewhere, but chances here are slim, and are zero if you never saved your file in the first place.

Since you say you were editing a CSS file, if you also had a page using it open in your browser and haven't closed it yet, it's possible that it's still available there e.g. in the resource panel in Chrome or something. Also if you type about:cache into Chrome (or whatever for your favorite browser) you can view the cache, perhaps it is there, although I do not know if browsers make a habit of caching local files.

In the future, presuming you continue to use Notepad++, I recommend enabling automatic backups:

  1. Settings → Preferences → Backup
  2. Check "remember current session", "enable session backups", and enter your favorite settings.

I also recommend using something like git or another version control system to keep your source files in, committing after large changes, so worst case you can restore to a previous commit.

Bummer. Good luck!

like image 58
Jason C Avatar answered Jan 13 '23 14:01

Jason C