Lost code lines when Notepad++ crashed

前端 未结 9 1450
星月不相逢
星月不相逢 2020-12-04 10:56

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,

相关标签:
9条回答
  • 2020-12-04 11:29

    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.

    0 讨论(0)
  • 2020-12-04 11:30

    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.

    0 讨论(0)
  • 2020-12-04 11:36

    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

    0 讨论(0)
  • 2020-12-04 11:43

    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.

    0 讨论(0)
  • 2020-12-04 11:45

    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

    ** 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!

    0 讨论(0)
  • 2020-12-04 11:45

    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
    0 讨论(0)
提交回复
热议问题