Lost code lines when Notepad++ crashed
Asked Answered
P

9

80

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...

Phiona answered 11/6, 2014 at 8:55 Comment(2)
My condolences. I do not think data recovery is possible here because it appears that the file on disk was overwritten and the contents of the buffer were most likely in memory. In the future, use an editor that automatically generates backups?Frisse
I have also faced this issue more frequently during last couple of weeks. Could be related to the latest version as it never happened before. I recovered my files from compiled APK file. Can someone suggest a better text editor for js files? ThxBlackleg
T
179

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.

Tiaratibbetts answered 16/12, 2014 at 11:21 Comment(1)
Unfortunately, my code was not backed up. Why would it ever overwrite a file with a blank file though? This makes no sense whatsoever.Recital
T
38

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.

Telegraphone answered 8/5, 2016 at 2:15 Comment(2)
After fruitlessly searching for files that were unsaved in the backup directory, I found all of them in that recovery one. I had missed it since I only found the Notepad++ folder in roaming but didn't think to look in Local\Temp. Since Notepad++ recovers unsaved files fine after closing and opening the program I figured they had to be SOMEWHERE. Thanks so much!Bunt
please note that sometimes this directory is not visible by default, it is better to enter it in the searchbar lineToupee
J
13

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.

Jacinda answered 3/11, 2014 at 10:32 Comment(2)
Awesome I didnt know about the previous versions tab in windows. I was able to recover and older version I had lost which was further along than my rewrite.Gavrila
thank you - saved me having to go to my lasted saved back up version which was recent - but did not include the last several days of work. Very appreciative!Propane
C
12

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!

Cusped answered 10/4, 2016 at 13:2 Comment(3)
I missed the backup option in the settings. Thanks for letting me know!Sclerodermatous
I wish backup had been the default setting. I just lost a "New 1" file where I think I had been (for multiple days) taking notes as I worked. It's far worse when you don't know exactly what it was you lost!Erlking
I've migrated to VSC 2 years ago, and I have no issues and a better work environment. If you are here because it was crashing on you, you should do the same. RIP, Notepad++! It was a helpful dev tool but now I used mostly as a text editor.Cusped
S
8

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

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

Supplicatory answered 21/9, 2017 at 6:30 Comment(1)
Lots of files there...except the one I need lol (laughing but crying)Lugansk
A
3

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.

Algonquian answered 16/1, 2015 at 21:0 Comment(0)
B
0
  • 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
Bader answered 11/6, 2014 at 9:4 Comment(4)
Well that's what I'm using, the latest version of Notepad++, and I was saving my file everytime when a modification was done. But this time, it crashed, and erased everything that was in my file... I probably lost my work yes :(Phiona
you don't mentioned in your question you are using notepad++.Bader
not really what I need, but it might help in the future, thanksPhiona
Not true. Indrajit's solution works so no, you haven't lost your work, thankfully!Desk
W
0

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
Wye answered 16/3, 2017 at 7:35 Comment(0)
E
0

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

Enmesh answered 14/12, 2017 at 1:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.