如何恢復未儲存或已刪除的 Notepad++ 檔案

Losing a tab after a crash, restart, or accidental closure can wipe out hours of work in seconds. The good news is that Notepad++ may have stored a temporary snapshot even if you never clicked Save. This guide explains how to recover Notepad++ unsaved files, where to look first, and when a 刪除的檔案復原 scan is appropriate. If the missing content had already been written to disk, Magic Data Recovery can also search for deleted TXT files and lost Notepad++ backup copies.
支援 Windows 7/8/10/11 和 Windows Server
Act before troubleshooting: Avoid installing programs, downloading large files, or running cleanup tools on the affected drive. New data may overwrite a deleted text file or backup snapshot.
目錄
Can Notepad++ Recover an Unsaved File?
Sometimes. The answer depends on whether Notepad++ wrote the text to its backup folder before the loss occurred.
Notepad++ can create a session snapshot of edited tabs at a set interval. The default backup location for a standard installation is usually:
- %AppData%\Notepad++\backup
However, this snapshot is temporary. According to the official Notepad++ user manual, Notepad++ uses periodic backups for changed files and removes a snapshot after the related file is saved. Closing an unsaved tab and choosing not to save it may also remove the temporary copy.
This distinction matters because Notepad++ recover files methods do not all solve the same problem:
| 發生了什麼事? | 最佳的第一種方法 | Can recovery software help? |
| Notepad++ crashed with the tab still open | Reopen Notepad++ and check the restored session | 通常不必要 |
| An unsaved tab disappeared after a restart or update | Check the Notepad++ backup folder and session.xml | Possibly, if a snapshot existed and was deleted |
| A saved .txt, code, or log file was deleted | Check Recycle Bin, File History, then scan the drive | Yes, if the file has not been overwritten |
| A file was replaced or saved with unwanted changes | Check backup-on-save, Previous Versions, or cloud history | Recovery tools may find an older deleted copy |
| The document was never saved and periodic backup was disabled | No disk copy may exist | Usually not; software cannot reconstruct text never written to storage |
How to Recover Notepad++ Unsaved Files: 7 Practical Methods
Start with the least invasive option. Do not jump straight to a full disk scan if Notepad++ still has a valid session snapshot.
Method 1: Reopen Notepad++ and Check the Previous Session
If Notepad++ or Windows closed unexpectedly, launch Notepad++ once and wait for the tabs to load. When Remember current session for next launch and periodic backup were enabled, the program may reopen unnamed tabs such as new 1 together with unsaved changes in named files.
As soon as the missing tab appears:
- 選擇 檔案 > 另存新檔.
- Give the document a clear filename and extension.
- Save it to a backed-up folder, preferably on another drive if the original disk has errors.
Do not repeatedly close and reopen the application. Session information can change during each launch, so save any recovered content immediately.
Method 2: Open the Default Notepad++ Backup Folder
For most standard Windows installations, the backup directory offers the fastest answer to how to recover Notepad++ unsaved files.
- 新聞 贏 + R.
- Paste %AppData%\Notepad++\backup and press 輸入.
- 依下列方式排序資料夾 修改日期.
- Look for names such as new 1@2026-08-24_091500 or notes.txt@2026-08-24_091500.
- Copy promising files to a different folder before opening them.
- Open each copy in Notepad++ and save the correct one with its intended extension.
Do not search only for *.txt. Periodic snapshots often end with a timestamp rather than .txt, so a wildcard search can miss the exact file you need.
Method 3: Check the Configured or Portable Backup Location
The default AppData path is not universal. A portable Notepad++ installation can keep configuration files and backups near notepad++.exe. Users can also select a custom directory.
開啟 設定 > 偏好設定 > 備份 and inspect these options:
- Remember current session for next launch
- Enable session snapshot and periodic backup
- Backup path
- Backup on save settings
If a backup path appears, copy it into File Explorer. For portable mode, check the Notepad++ installation directory for a backup subfolder. When the application is unavailable, search the computer for folders named Notepad++, then inspect recently modified backup directories.
Keep in mind that session snapshot and periodic backup differs from backup on save. The former temporarily protects unsaved changes. The latter can create .bak copies when you actively save a document.
Method 4: Use session.xml to Find the Backup File
When the backup folder contains dozens of timestamped items, session.xml may map a missing tab to its snapshot.
- Close neither Notepad++ nor any recovered tabs until you have copied the relevant folders.
- Open %AppData%\Notepad++ in File Explorer.
- Copy session.xml and the entire backup folder to a safe location.
- Open the copied session.xml in another editor.
- Search for the original filename, tab name, or backupFilePath.
An entry may show the original filename and a timestamped backupFilePath. Browse to that path, copy the backup, and open the copy. This approach is especially useful when you need to recover Notepad files whose backup names no longer resemble the original project names.
session.xml is an index, not the document itself. If it references a backup that no longer exists, move on to Recycle Bin, Previous Versions, or a deleted-file scan.
Method 5: Search Windows, Recycle Bin, and Recent Locations
The file may be saved rather than unsaved. It might have a different extension, live in another folder, or have been moved accidentally.
試試這些檢查:
- Open File Explorer and search 此電腦 for a distinctive phrase, the filename, *.txt, or the expected code extension.
- 依以下條件排序結果 修改日期.
- 檢查 Home/Quick access > Recent and Notepad++’s File > Open Recent File 菜單。.
- Open Recycle Bin and search by name, file type, or deletion date.
- If the file appears, restore it or copy it to a safe location.
For an accidental move or rename that just happened in File Explorer, Ctrl + Z may undo the operation. Use this only when you clearly know what the most recent file action was.
Method 6: Restore a Previous Version or Cloud Copy
Windows and cloud services can preserve versions that Notepad++ itself no longer holds. Right-click the original file or its parent folder, choose 屬性, ,並開啟 先前版本. Available copies may come from File History or restore-point data.
Before clicking Restore, use 開啟 to inspect the version. Then copy the desired document elsewhere. Restoring in place can replace the current folder contents.
If the file lived in OneDrive, Dropbox, Google Drive, Git, or another synced location, check the service’s web-based recycle bin and version history. This is often the best fix for an overwritten file because it preserves distinct historical versions rather than searching raw disk space.
Searching %TEMP% is a low-probability fallback, not the main Notepad++ recovery method. Notepad++ normally relies on its configured snapshot folder. Still, you can enter %TEMP% in Run, sort by date, and inspect recent text-like files if every documented location is empty.
Method 7: Recover Deleted Notepad Files with Magic Data Recovery
Use recovery software when a saved TXT file, a .bak copy, or a Notepad++ snapshot existed on disk and was later deleted. This is different from recovering text that never left the computer’s memory.
Magic Data Recovery addresses the situations that built-in Notepad++ methods cannot: permanent deletion, an emptied Recycle Bin, accidental formatting, a RAW or damaged file system, and files lost from internal or external storage. It supports quick and deep scanning, previews recoverable files before saving, and recognizes more than 5,000 file types.
To use it safely:
1. Stop writing new data to the drive that held the missing file.
2. Download and install Magic Data Recovery on another drive when possible.
支援 Windows 7/8/10/11 和 Windows Server
3. Launch it and select the affected partition or storage device.

4. Start the scan, then filter results by path, file type, name, size, or modification time.

5. Preview likely TXT, source-code, log, .bak, or Notepad++ snapshot files.
6. Recover selected items to a different drive.

Why is this approach more reliable than searching random temporary folders? It scans storage for file-system records and recognizable file data rather than depending on one guessed path. It can therefore recover Notepad files that Windows no longer lists. Still, no responsible tool can guarantee recovery: SSD TRIM, secure deletion, physical damage, and overwritten sectors may make a file unrecoverable.
Notepad++ Backup Recovery vs. Data Recovery Software
Choosing the right method saves time and reduces unnecessary disk activity.
選項 | 最適合 | 主要優勢 | 限制 |
Reopen previous session | Crash or forced restart | Fast and built into Notepad++ | Depends on session settings and intact snapshots |
Notepad++ backup folder | Unsaved changes captured periodically | Preserves the latest temporary text | Snapshot may disappear after saving or discarding the tab |
Backup on save / .bak | Older version of a saved file | Simple copy with readable content | Must have been enabled beforehand |
Windows or cloud version history | Overwritten or synced documents | Can restore multiple versions | Requires prior backup or synchronization |
Magic Data Recovery | Deleted saved files or deleted snapshots | Scans beyond visible folders and supports damaged file systems | Cannot recover text that was never written to disk |
最好的 Notepad++ recover files workflow is therefore layered: check the active session, copy the backup folder, inspect version history, and scan the drive only when a disk copy likely existed.
Why the Notepad++ Backup Folder May Be Empty
An empty folder does not automatically mean Notepad++ malfunctioned. Common explanations include:
- Periodic backup was disabled before the loss.
- The interval had not elapsed before the crash.
- You saved the file, so Notepad++ removed the temporary snapshot.
- You closed the tab and chose 沒有 when asked to save.
- Notepad++ uses a custom or portable backup path.
- Another Windows account owns the relevant AppData folder.
- A cleanup utility, antivirus action, profile reset, or storage error removed the files.
- Multiple Notepad++ instances used different session behavior.
If you suspect deletion, preserve the folder and drive before running a scan. Continuing to work on the same system partition can overwrite the very snapshot you want to find.
How to Prevent Lost Notepad++ Work
Once you know how to recover Notepad++ unsaved files, spend a minute preventing the next incident.
- 開啟 設定 > 偏好設定 > 備份.
- 啟用 Remember current session for next launch.
- 啟用 session snapshot and periodic backup and choose a sensible interval.
- 開啟 backup on save for important work and use a dedicated backup directory.
- Save new tabs early with meaningful names.
- Store critical documents in a versioned or synced folder.
- Use Git for code and maintain a separate, tested backup for irreplaceable notes.
Periodic snapshots are a safety net, not an archive. If a document matters, save it as a real file and include it in a regular backup plan.
總結
To resolve how to recover Notepad++ unsaved files, first reopen the previous session, inspect %AppData%\Notepad++\backup, verify the configured backup path, and use session.xml to match tabs with snapshots. For saved files, also check Recycle Bin, Previous Versions, and cloud history.
When a TXT document or snapshot was actually written to disk and later deleted, Magic Data Recovery is worth trying because it can scan deleted files, formatted storage, and file-system errors while letting you preview results. It complements built-in backups; it does not invent content that was never stored. For more safe-recovery principles and related methods, visit the 已刪除檔案復原指南.
支援 Windows 7/8/10/11 和 Windows Server
FAQs About Notepad++ File Recovery
Notepad++ 會將未儲存的檔案儲存在哪裡?
若已啟用定期備份,標準安裝通常會將快照儲存於 %AppData%\Notepad++\backup 目錄中。可攜式安裝或自訂設定可能會使用其他目錄。請確認 設定 > 偏好設定 > 備份 在假設檔案遺失之前,請先檢查當前路徑。.
如何在 Notepad++ 中還原已關閉且未儲存的分頁?
請先重新開啟 Notepad++,然後檢查其備份目錄中是否有最近修改的、以 N@timestamp 為名的檔案。如果您是刻意關閉該分頁且未儲存內容,Notepad++ 可能已移除該快照,因此能否恢復就較不確定了。.
Notepad++ 能否在電腦重新啟動後恢復檔案?
是的,前提是已啟用工作階段記憶體和定期備份功能,且相關檔案仍完好無損。請先啟動 Notepad++ 一次,並檢查是否已還原分頁。若未顯示任何內容,請在嘗試更徹底的復原步驟之前,先複製備份資料夾和 session.xml 檔案。.
為什麼我的 Notepad++ 備份資料夾是空的?
可能是定期備份功能已被停用、快照間隔時間尚未到期,或是 Notepad++ 使用了不同的路徑。此外,當檔案儲存完成或未儲存的分頁被關閉後,程式也會自動刪除暫時性快照。.
我能否從「Temp」資料夾中還原一個未儲存的 Notepad++ 檔案?
您可以檢查 %TEMP%,但這只是次要的備用方案。Notepad++ 通常會將定期快照儲存於其設定的備份資料夾中,而非 Windows 的通用暫存資料夾。請先著重檢查官方的備份路徑和工作階段檔案。.
Magic Data Recovery 能否還原未儲存的 Notepad++ 檔案?
如果該資料已寫入磁碟且尚未被覆寫,本工具可能能夠恢復已刪除的 Notepad++ 快照或先前儲存的文字檔案。但本工具無法重建 Notepad++ 從未寫入儲存裝置的未儲存記憶體緩衝區。.
如何恢復已永久刪除的 TXT 檔案?
請停止使用受影響的磁碟,檢查現有的備份,並使用檔案回復工具進行掃描。將回復的檔案儲存至另一顆磁碟。回復結果取決於 Windows、SSD TRIM 或後續的操作是否已覆寫原始資料。.
重新安裝 Notepad++ 能否恢復未儲存的檔案?
Usually not. Reinstallation does not recreate a missing snapshot and may alter configuration data. Copy the existing Notepad++ AppData and backup folders first. Search or scan for lost files before installing anything on the affected drive.
Jason 在電腦資料安全產業擁有超過 15 年的實務經驗。他專精於資料復原、備份與還原,以及檔案修復技術,已協助全球數百萬使用者解決複雜的資料遺失與安全問題。.
