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

Notepad++ backup configuration

  • Checked Enable session snapshot and periodic backup and configured the below configurations. It will autosave in Notepad++
    • provide value taken up every n(5) seconds in the Backup in every second textbox.
    • Provide backup path location, as default location %APPDATA%\Notepad++\backup.
    • Default unsaved files location is C:\Users\user\AppData\Roaming\Notepad++\backup .
  • 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 Notepad++ unsaved file location

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 and filename.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 the steps required to do the recovered and unsaved files.

  • Open Notepad++ editor
  • Go to Settings > Preferences, It opens the Preferences window
  • Select Backup configuration as shown below

Notepad++ backup configuration

  • Get the value from Backup path - C:\Users\user\AppData\Roaming\Notepad++\backup

  • Open the path in the file browser Notepad++ unsaved file location

  • 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 the current session for the next launch by checking this feature, It opens all the previously saved and unsaved files in tabs in current sessions while starting to run 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 open the read.txt file, It saves read.txt.bak under the custom directory configured.

  • Verbose Backup:

It saves the files with the new file format yyyy-mm-dd_hhmmss including .bak extension in a custom directory.