Notepad++ is a source and text code editor that can open and save files.
Each file is opened as a new tab in Notepad++ by default.
You can manually save the files using File > save or the shortcut command Ctrl + S.
Sometimes, You made changes to a new or existing file and notepad++ closed unexpectedly due to a window restart or crashed or manually closed editor. Then, How do you recover unsaved files?
This tutorial talks about how to do the following things.
- restore unsaved closed files
- recover unsaved file location
- unsaved file session
- backup unsaved and closed files
- Restore saved and unsaved tabs
Notepad provides Enable session snapshot and periodic backup
features which you need to enable.
How to enable to save unsaved session files files
By Default notepad++ does not back up the unsaved files, You need to configure the below steps to take backup of a session.
- Open Notepad++ editor
- Go to Settings > Preferences, It opens the Preferences window
- Select Backup as shown below, It shows the backup configuration
- Checked
Enable session snapshot and periodic backup
and configure the below configurations. It will autosave in notepad++- provide value take up every n(5) seconds in the
Backup in every seconds
textbox. - Provide
backup path location
, as default location%APPDATA%\Notepad++\backup
. Default unsaved files location
isC:\Users\user\AppData\Roaming\Notepad++\backup
.
- provide value take up every n(5) seconds in the
- Finally, Click on the close button
- Now,Every unsaved file tab is saved for every 5 seconds at
C:\Users\user\AppData\Roaming\Notepad++\backup
location as a separate text file
Following are the files located
And the names of the files stored in this location are as follows.
Named files: saved with a name. This is stored as a name format
filename.ext@yyyy-mm-dd_hhmmss
andfilename.ext
is an original saved file name.unnamed files: these are unsaved files, i.e without the name(new NNN, N is sequence numbers) in tabs. the unsaved file name is
new NNN@yyyy-mm-dd_hhmmss
and the new NNN is the name of the tab opened.
How to recover unsaved file tabs session in Notepad++
The following are steps required to do the recovered and unsaved files.
- Open Notepad++ editor
- Go to
Settings
>Preferences
, It opens thePreferences
window - Select
Backup
configuration as shown below
Get the value from Backup path -
C:\Users\user\AppData\Roaming\Notepad++\backup
Open the path in the file browser
You can open the file or copy the file to a safe location for later use.
Other Notepad++ backup feature options
The backup feature allows you to save saves or not.
`Remember current session for next launch by checking this feature, It opens all the previously saved and unsaved files in tabs in current sessions while starting running Notepad++
Custom Backup Directory: It contains a Directory textbox to save files Custom folder Location.
backup on save
: It has three options- None, the Default option
- Simple Backup: It creates and saves a .bak file with the same name and extension in a custom directory.
For example, if you opened the read.txt file, It saves read.txt.bak under the custom directory configured.
- Verbose Backup:
It saves the files with new file format yyyy-mm-dd_hhmmss including .bak
extension in custom directory