Best 5 Methods to Recover Deleted Text File: A Complete Guide 2025

Christina
Written byChristinaUpdated on Jun 20, 2025
Gerhard Chou
Approved byGerhard Chou

Table of Contents

Before we start: Delete a critical text file by mistake or format a drive that contains all your text files? Don't panic, the deleted or lost text files can be easily recovered by data recovery software - such as Donemax Data Recovery. It can securely and completely recover permanently deleted text files, recover lost text files from formatted drive or reinstalled operating system, etc.

Accidentally deleting a text file can be frustrating - especially when the file contains important notes, code snippets, logs, or documentation. Fortunately, deleted text files are often recoverable through a variety of methods, whether you're using Windows or macOS. This comprehensive guide will walk you through the most effective techniques to recover your lost .txt files, from basic recovery steps to advanced tools.

recover deleted text file

Why Text Files Get Deleted or Lost?

Before diving into text file recovery methods, it's helpful to understand how files get deleted and what happens afterward.

Common Causes of Deletion:

  • Accidental deletion: Pressing Shift + Delete or emptying the Recycle Bin/Trash without checking.
  • Software crash: Apps crashing before saving data.
  • System restore or disk formatting: Overwrites disk sectors.
  • Virus or malware attack: Corrupts or removes files.
  • User error: Saving over an existing file by mistake.

When a file is deleted, the operating system typically marks its disk space as "available" but doesn't immediately erase the content. This means recovery is often possible if you act quickly and avoid saving new files to the same drive.

5 Reliable Methods to Recover Deleted or Lost Text (.txt) Files

Don't put new files to the drive where you deleted or lost the text files, then choose a method depending on the data loss situation for recovering the lost  text files.

Method 1. Recover Deleted Text Files from Recycle Bin or Trash

Windows:

  1. Open the Recycle Bin from your desktop or Start menu.
  2. Use the search bar to filter .txt files or scroll manually.
  3. If you find your file, right-click > Restore to return it to its original location.

    Recover Deleted Text Files from Recycle Bin

macOS:

  1. Click on the Trash icon in the Dock.
  2. Browse or search for the deleted file.
  3. Right-click > Put Back to restore it.

    Recover Deleted Text Files from Trash

You also can recover deleted text files from Recently Deleted or Recycle bin on Cloud such as iCloud, Google Drive, OneDrive, etc.

This is the simplest and quickest method - perfect if the deletion was recent and you haven't emptied the bin yet. (Normally, the deleted files can be stored in recycle bin or trash bin for 30 days)

Method 2. Restore Lost Text Files from File History or Backups

Operating systems offer built-in backup features that may have saved a previous copy of your file.

Windows File History:

  1. Go to the folder where your file was located.
  2. Right-click > Properties > Previous Versions.

    Restore Lost Text Files from File History

  3. Choose a version and click Restore.

    Restore Lost Text Files from File History

Note: File History must be enabled beforehand for this to work.

macOS Time Machine:

  1. Connect your Time Machine drive (if disconnected).
  2. Navigate to the folder where the file was.
  3. Open Time Machine from the menu bar.

    Restore Lost Text Files from Time Machine

  4. Use the timeline to locate an earlier version and click Restore.

    Restore Lost Text Files from Time Machine

Other Backup Tools:

If you use tools like Donemax Disk Clone, Acronis, Backblaze, or Macrium Reflect, check their dashboards to restore previous snapshots or versions.

Method 3.  Recover Text Files from Temporary or Auto-Saved Files

Some applications or the OS might create temporary files while you're working. These can sometimes be recovered even after deletion.

On Windows:

  1. Press Win + R, type %Temp%, and hit Enter.

    Recover Text Files from Windows Temporary

  2. Browse for files with a .tmp or .txt extension.

    Recover Text Files from Windows Temporary

  3. You may also check C:\Users\[YourName]\AppData\Local\Temp.

Notepad++ Recovery (if used):

Notepad++ can auto-recover unsaved sessions:

  • Navigate to: C:\Users\[YourName]\AppData\Roaming\Notepad++\backup.
  • Look for .txt files and open them in Notepad++.

On macOS:

  1. Open Finder and go to Go > Go to Folder.

    Recover Text Files from Mac Temporary or Auto-Saved Files

  2. Enter: /private/var/folders and search for .txt files.

    Recover Text Files from Mac Temporary or Auto-Saved Files

While temp file recovery is hit-or-miss, it can work for unsaved or crash-related losses.

Method 4. Use Data Recovery Software to Recover Deleted or Lost Text Files

When files aren't in the Recycle Bin or temp folders, dedicated data recovery tools can scan your hard drive for remnants of deleted text files. There are many data recovery tools that can recover permanently deleted text files or erased text files. Donemax Data Recovery is one of them, it supports to recover 2000+ file formats including .txt, .rtf, .doc/.docx, etc.

Donemax Data Recovery

  • Recover lost text files from Windows PC, Mac, HDD, SSD, USB drive, SD card, etc.
  • Recover deleted, formatted, erased or lost text files.
  • Recover inaccessible, corrupted, unsaved text files.

Follow the steps below to recover deleted or lost text files by using Donemax Data Recovery:

Step 1. Just download and install Donemax Data Recovery on your computer, then open it. It shows all drives and devices, just select the drive where you delete or lose the text files. 

select the drive where you delete or lose the text files

Step 2. Click on Scan button. Donemax Data Recovery is able to deeply scan the selected drive and find the deleted/lost files including the text files that were deleted or lost.

scan the selected drive and find the deleted/lost files

Step 3. When the scan gets finished, it lists all found files. Just find the deleted or lost text files. Before recovery, you can preview the text files to check their quality. Then select the text files you want to recover, click on Recover button to save them.

click on Recover button to save them

Note:

  • Don't save the recovered files to the drive where you delete or lose the files to prevent overwriting.
  • Donemax Data Recovery allows you to recover up to 200MB of files without paying.
  • If you want to recover text files from a corrupted drive, just choose Disk Manager. Select the drive, click Repair to repair the corrupted drive.

★ Best Practices for Using Recovery Tool for Text File Recovery

To maximize your success when recovering deleted text files:

  • Install on a Different Drive: Never install recovery software on the same partition where your file was deleted - it could overwrite the lost data and make it unrecoverable.
  • Use Deep Scan if Needed: If the Quick Scan doesn't find the file, run a Deep Scan for a thorough sector-by-sector search. This takes longer but yields better results. Donemax Data Recovery performs quick scan + deep scan by default.
  • Preview Before Recovery: Most modern tools let you preview recovered files. This is particularly useful to verify that a .txt file is complete and readable before restoring.
  • Restore to a Safe Location: Always choose a different storage location (e.g., external drive or another partition) to save the recovered file. This helps avoid overwriting other recoverable data.

★ What to Expect in Terms of Recovery Success

√High Recovery Chances:

  • The file was deleted recently.
  • The disk hasn't had new files saved since deletion.
  • The file system isn’t corrupted.

×Lower Recovery Chances:

  • File has been overwritten.
  • Drive has been formatted or partitioned.
  • SSDs with TRIM enabled (data is often wiped immediately).

★ When to Call a Professional

If none of the above tools work and the file is mission-critical (e.g., legal or professional documents), consider reaching out to a professional data recovery service. These services use advanced forensic tools and clean-room environments to extract data even from damaged or failing hardware.

Professional recovery can be expensive (ranging from $300 to $2000), so it's usually a last resort.

Check the best data recovery providers in 2025 >>

Method 5. Recover Lost Text Files from Cloud Storage

If you use cloud storage services, your deleted file might still be recoverable from the trash or version history.

Google Drive:

  1. Visit drive.google.com.
  2. Go to Trash from the left sidebar.
  3. Right-click the file and choose Restore.

Dropbox:

  1. Log in to dropbox.com.
  2. Click Deleted Files in the sidebar.
  3. Locate and restore the deleted file.

OneDrive:

  1. Go to onedrive.com.
  2. Open the Recycle Bin.
  3. Restore the file with a single click.

Version History (Cloud):

Some services allow you to revert to earlier versions:

  • Google Drive: Right-click > Version history.
  • Dropbox: Click the three-dot menu > Version history.

Cloud sync can be a lifesaver - especially if you regularly work across devices.

Advanced: Command Line Recovery

If you're technically skilled or the file is on a corrupted drive, command-line recovery tools can help.

TestDisk & PhotoRec (Free, Open Source):

  • PhotoRec recovers files by ignoring the filesystem and targeting file headers.
  • Works well for raw drives, external USBs, and SD cards.

Steps:

  1. Download from https://www.cgsecurity.org/.
  2. Run PhotoRec in terminal or command prompt.
  3. Select the drive and choose file types (e.g., .txt).
  4. Let it scan and save files to a designated folder.

chkdsk (Windows-only):

Run this if file system corruption is suspected:

chkdsk X: /f

It might fix logical errors that restore access to missing files or folders.

Tips to Prevent Future Text File Loss

After recovering your text file, consider these best practices to avoid future data loss.

1. Enable File History (Windows) or Time Machine (macOS)

  • Configure these tools to take regular backups.

2. Use Cloud Sync Services

  • Google Drive, OneDrive, or Dropbox can automatically sync your files.

3. Save Frequently and Create Backups

  • Use Ctrl + S often.
  • Keep duplicate copies in separate folders or drives.

4. Use Version Control (for Coders)

  • Tools like Git track changes and prevent total loss.
  • GitHub or GitLab also act as cloud backups.

5. Consider Disk Imaging Software

  • Tools like Donemax Disk Clone or Acronis can back up your entire system periodically.

Conclusion

Accidentally deleted a text file? Don't panic - your file may still be recoverable. Start by checking your Recycle Bin or Trash. If that fails, try built-in recovery tools like File History or Time Machine. For more complex scenarios, use data recovery software or check your cloud backups. And if you're tech-savvy, advanced command-line tools like PhotoRec can work wonders.

Act quickly and avoid writing new data to the affected drive to increase your chances of recovery. Finally, implement regular backup strategies to protect your files going forward. With the right tools and knowledge, lost text files don't have to stay lost.

FAQs About Recovering Deleted Text Files

Donemax Data Recovery software can help recover permanently deleted text files:
  • Download and install Donemax Data Recovery on your computer, open it.
  • Select the drive containing the deleted text files.
  • Click on Scan button to deeply scan the selected drive.
  • Preview and recover text files after scanning.

Here are some of the most reliable and widely-used recovery applications that work on both Windows and macOS for text file recovery:

  • Donemax Data Recovery
  • Recuva
  • Magoshare Data Recovery
  • TestDisk & PhotoRec
  • Stellar Data Recovery
Follow the steps below to recover unsaved text file:
  1. Open the Start menu.
  2. Type %AppData%.
  3. Press enter to go to "C:\Users\%USERNAME%\AppData\Roaming" .
  4. Search all ".txt" files, then select the wanted text file, copy it to another location.

Run Donemax Data Recovery to deeply scan the formatted drive. Then click Type > Documents, find all text files. Select the wanted text files, click on Recover button to save them.

logo stage

Donemax Data Recovery

Donemax Data Recovery is one of the best data recovery software. It is easy-to-use and can help in recovering deleted, formatted, inaccessible or lost data from HDD/SSD, external disk, USB drive, SD card, camera or other storage devices.

Christina
Contributing Writer

Christina

Christina is the senior editor of Donemax software who has worked in the company for 4+ years. She mainly writes the guides and solutions about data erasure, data transferring, data recovery and disk cloning to help users get the most out of their Windows and Mac. She likes to travel, enjoy country music and play games in her spare time.

Gerhard Chou
Editor in chief

Gerhard Chou

In order to effectively solve the problems for our customers, every article and troubleshooting solution published on our website has been strictly tested and practiced. Our editors love researching and using computers and testing software, and are willing to help computer users with their problems