Lost code lines when Notepad++ crashed

FileNotepad++LinesLoss

File Problem Overview


I was working on a .js file this morning on Notepad++, as usual, when the program just crashed. So I ended it, and re-opened it to see that all my code lines in my .js file, had disappeared, and now all I have left is the file with a size of 0kb because there's nothing left in it. How the hell is that even possible ? It erased everything I typed and saved the file as if there's nothing in it.

Do you know a way to get my code back ? Or did something like this ever happened to someone ? :/ I'm kinda worried because there was a lot of work there and I don't feel like re-typing it all...

File Solutions


Solution 1 - File

When that option is enabled (and it is by default), Notepad++ keeps a backup copy of files you edit.

You can find the backups in the directory %APPDATA%\Notepad++\backup under the format filename@datetime.

Solution 2 - File

I lost four unsaved files when my Notepad++ crashed, I searched through net and found another way to retrieve unsaved files other than backup folder

> C:\Users\{username}\AppData\Roaming\Notepad++\backup

Hope it can help others who face the same problem as me. You can try to locate the dump files at

> C:\Users\{username}\AppData\Local\Temp\N++RECOV

There will be .dump file inside, this is where I found my unsaved files. You can open the dump file with Notepad++, and see your unsaved works.

Solution 3 - File

This has happened to me a few times lately and I've found a few solutions that make it possible to recover the lost code.

For Windows 7 and probably other modern Windows versions:

  • Find the file in File Explorer. The size will be 0KB. Right click on it and then choose Properties from the context menu.
  • Choose the Previous Versions tab. There's a good chance you will find a fairly recent version saved during the latest Restore point. If it's a bit old, it's still probably better than the current 0KB.
  • Click the Restore button.

My personal optimal solution:

Since this happened to me a few times and the Windows Previous Version was not always up to date, I looked for a different solution that could always give me the latest, most up-to-date version before the 0KB crash.

I discovered that I already had the solution installed on my computer. I have a SugarSync account that always backs up my work files to the cloud. The great part of the service is that SugarSync always keeps the last 5 versions in the cloud, so while the current version will be 0KB, you can download the next to last version and update your file on your computer.

If you have some other backup program, you can check if that service also keeps different versions that you can recover.

Solution 4 - File

I've used notepad++ without any backup for years. One day this happen to me, too.

Here is what I've found as possible solutions:

http://buffernow.com/notepad-plus-crash-recover-your-lost-file/ (similar to Indrajit answer) - not much help. I didn't find my file there.

I have recovered my file one week ago as per answer of Hvck

Same problem here. Same answers: https://superuser.com/questions/390204/how-to-restore-a-previous-version-of-file-in-notepad

One lesson learned: Use the backup!

  1. use a plugin: http://www.ilovefreesoftware.com/12/windows/two-plugins-auto-save-files-notepad-auto-save-autosave2.html

  2. use notepad++ backup http://allinworld99.blogspot.ca/2015/01/notepad-backup-files.html

notepad++ backup

** UPDATE **

It happened to me again!!! Another way to recover my file: View source on my browser and resave the file to other location. If you are lucky enough to have the file loaded in your browser :) It worked for me for a css file and for a js file.

Comparing the files: what N++ backed-up and the file from browser and files are matching. OMG!

Solution 5 - File

GO to Taskbar click and run %APPDATA%, click to Notepad++ click to backup.

Your files saved by filename.extensionname@year-month-date_time

Solution 6 - File

I know it's too late to answer this, but maybe my answer will help others.

I've encountered the same problem recently. Then it became regular. I did not find a solution to the problem itself, plus it may be caused by many different reasons, so probably no universal solution exists.

However, there is a way to save your files while notepad++ is not closed. Even if the backups folder is empty.

First of all, do not close notepad++. Open a taskmanager, find the notepad++ process and locate the Dump or Create dump file option. Click it. This will create a whole memory dump of the process. This dump will contain the documents you had opened. However you may need to find this data, plus it may be in a different encoding. I guess it is in UTF8 most of the time, but I am not completely sure.

The dump file can be examined with simple programs like notepad++ itself or with a hex editor.

Solution 7 - File

  • Notepad doesn't auto-save its open file so unfortunately you have lost your work.
  • On next time you can use Notepad++ it retrieves file automatically
  • Refer this link may it help you Notepad++ recovery

Solution 8 - File

I tried all the above solutions but nothing was working for me.

But luckily I have opened files one day earlier in eclipse as well. Eclipse and all other IDEs maintain a cache of all the files. You can get the copy of the file from that cache. To get copy from the eclipse.

  • Right Click on the file Name
  • Go to Replace With - Previous from the Local History

Solution 9 - File

This answer applies to more recent versions of NotePad++: Go to the folder of the file, see if there is a subfolder called nppBackup. Recently I've found sometimes the backup wasn't created in %AppData%/Notepad++/backup but it always seems to get created here, with the following file name format [original file name][date stamp]_[time stamp].bak

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNetero_samaView Question on Stackoverflow
Solution 1 - FileIndrajitView Answer on Stackoverflow
Solution 2 - FileEstin ChinView Answer on Stackoverflow
Solution 3 - FileHvckView Answer on Stackoverflow
Solution 4 - FileAdrian P.View Answer on Stackoverflow
Solution 5 - FilePankaj UpadhyayView Answer on Stackoverflow
Solution 6 - FileAneriView Answer on Stackoverflow
Solution 7 - FileDhruvin SukhadiyaView Answer on Stackoverflow
Solution 8 - FileAkshay KhopkarView Answer on Stackoverflow
Solution 9 - FileclayRayView Answer on Stackoverflow