Modern Windows 11 Notepad can restore unsaved tabs when its session-saving feature is available and enabled. Older versions do not provide the same mechanism. For a deleted TXT that was saved before, use deleted items, backups or storage recovery instead. These are separate data sources.

Preserve text that is still visible
If text appears in an open Notepad tab, use Save As and choose a clear filename on healthy storage. Reopen the file to confirm its contents and encoding. Do not reset or reinstall Notepad as a first recovery step; that can remove application state you need.
Record the Windows and Notepad versions. Microsoft introduced saved session state in Windows 11 Notepad version 11.2307.22.0 through its Insider rollout. Its announcement explains that unsaved tabs and edits can return, but that session state does not itself save changes to original files. See Microsoft’s Notepad announcement.
Availability depends on the installed Notepad version and its settings. Check whether session saving was enabled before the loss.
Look for a retained tab
Reopen the same Notepad installation under the same Windows account and inspect restored tabs. A different account, reset app or different installation may have different state. If a useful tab returns, save it as a new file before closing tabs or changing settings.
If text was deliberately discarded when closing a tab, or no session was retained, there may be no supported saved copy. Do not assume a random temporary file is a complete TXT backup. Session internals vary by version; manually replacing app-state files without a matched procedure can damage other tabs.
Recover a previously saved TXT file
For a deleted saved file, check Recycle Bin and the original location. Search the expected folder and any actual cloud or backup destination. If File History protected that folder, open a historical version and copy the TXT to a recovery location. This requires an existing backup; see Microsoft’s File History guide.
If no copy exists and the original disk remains readable, XRecovery can search remaining text/document files. Save candidates to a separate physical device. A scan can look for data that reached storage, but cannot create unsaved text that existed only in memory.
Check the whole text and its encoding
Inspect the first and last lines, line breaks, punctuation and non-English characters. Wrong encoding can display garbled characters even when bytes are present; compare with a known copy before resaving. Check configuration files for closing sections and structured data for truncation. A normal-looking opening line is insufficient.
Preserve the original candidate while evaluating alternatives. If no tab, saved file or backup contains the passage, record that gap rather than describing a restored empty tab as recovered work.
For the next step, see Document Recovery: Deleted, Unsaved, Overwritten or Damaged?.