How to Undo a Delete Operation on Windows and Mac

Written by
Approved by

how to undo deleteDeleting files you didn’t intend to. We’ve all been there. Fortunately, Windows and macOS let you undo a delete and get back the files you deleted. In most cases, you won’t even require a third-party tool. How? In the sections below, we explain how to undo delete operations on both OSes, and how to recover your files in case you’re unable to undo the delete command.

Is It Possible To Undo a Delete Operation

Yes. Not only is it possible, but it’s also more straightforward than you think. Before we explain how, let’s first take a look at what actually happens when you delete a file and where it goes.

When you give the delete command to your OS, it doesn’t actually “wipe” the file out of the drive. Instead, the exact location it occupied is marked as available for use. In essence, the file is still there, just the path towards it has been forgotten. The file will remain at the location, until a new file overwrites it. This is applicable even if you empty the Recycle Bin, or Trash.

The delete operation can be undone using data recovery tools, as long as the file hasn’t been overwritten by new data. That’s why it’s universally recommended that you stop using the storage drive as soon as you notice data loss. Of course, if the file is in the Recycle Bin, or Trash, you can simply restore it.

In the case of SSDs, undoing a delete operation can be tricky. This is because of the TRIM feature–which periodically and clears up data locations that are available for use. While TRIM does improve the efficiency and lifespan of SSDs, it makes data recovery difficult. When dealing with SSDs, it’s best to perform data recovery ASAP, before the TRIM command has a chance to execute (usually during startup).

How to Recover Permanently Deleted Files

A good data recovery tool is your best bet when it comes to recovering permanently deleted files. However, it’s advisable to do your research when selecting a data recovery software. You should pick one that has a good track record, works with the file system your drive uses, and is easy to use.

Keeping these factors in mind, we opted for Disk Drill in our tutorial. The program has a proven history of recovering data from a variety of devices and file systems, a modern UI with built-in instructions, and a cutting-edge data recovery algorithm. Disk Drill is available for both Windows and macOS. However, Windows users get a free trial that lets them recover up to 500 MB of data for free. Regardless, both versions of Disk Drill will let you preview your recoverable files for free. You only pay if you wish to proceed with the recovery.

The data recovery steps on Disk Drill remain the same for Windows and macOS:

  1. Download Disk Drill and install it. Do so on a separate storage drive and not the one which suffered data loss.
  2. Open Disk Drill, select the storage drive which contained the accidentally deleted files, and click on Search for lost data.Search for lost data in macOS.
  3. Click on Review found items to view all the recoverable files Disk Drill discovered. If you only wish to view certain file types, click on the relevant tile instead (Pictures, Video, Audio, Documents, Archives, and Other).Review found items screen in Disk Drill.
  4. Expand the Deleted or lost and Reconstructed sections.Data recovery sections in Disk Drill.
  5. Select the files you wish to recover and click Recover. Disk Drill displays a preview of the currently selected file, but you can manually preview any file by clicking the eye icon next to its filename.List of recoverable files in Disk Drill.
  6. Choose a recovery destination for the files and click Next. Again, it’s best to save them on a different storage drive and not the one that originally contained them.Recovery destination prompt in Disk Drill.
  7. Disk Drill will recover the selected files.

4 Methods to Undo Deletion

Unwilling to use a third-party data recovery tool? Well, there are some other ways that can potentially help you undo a delete operation. These methods are universally applicable to Windows and macOS, but they do differ in their execution.

Method 1: Use the Undo Feature

As long as you haven’t performed other clipboard-related operations on your computer (such as copying and pasting), or rebooted it, you can undo the delete operation in both Windows and Mac.

Here is how to undo a delete operation on a Windows computer:

  1. Open Windows Explorer (Windows Key + E) and open the folder that contained the deleted file.
  2. Right-click on the white space and choose Undo Delete. In older versions of Windows, it will be labeled as Undo move.Undo delete option in Windows.
  3. The deleted file should reappear.

On macOS, the process is similar:

  1. Open Finder and navigate to the folder from which the file was deleted.
  2. Go to the Edit option and click on the Undo move of option.Undo move of option in macOS.
  3. The deleted file will be restored.

Method 2: Check the Recycle Bin, and Trash

Both Windows and macOS have dedicated folders – Recycle Bin, and Trash, respectively – that store deleted files until they’re restored, or further deleted permanently. Depending on how you’ve configured the OS, the folders may be periodically emptied as well.

It’s a good idea to check these folders for the deleted folders, before performing full-fledged data recovery:

Here’s how to restore deleted files from the Recycle Bin on Windows:

  1. Double-click the Recycle Bin icon on the desktop, or search for it in Windows Search (Windows Key + S)
  2. Look for your deleted files. If you can find them, right-click on them and choose Restore.Recycle Bin in Windows.
  3. The deleted files will be restored to their original locations.

On macOS, check the Trash/Bin folder:

  1. Click on the Trash/Bin icon on the dock.
  2. Right-click on the deleted files and choose Put back.Put Back option in macOS.
  3. The files will be restored.

Method 3: Restore the Files From a Backup

Unable to locate your files in the Recycle Bin, or the macOS Trash? Your next best option is to check whether you have a Windows File History, or Mac Time Machine backup. If you do, you can easily restore your files using the drive on which the backup is stored. We’ll describe this process in detail below.

Here’s how to use Windows File History to undo what you deleted:

  1. Ensure the drive used to set up File History is connected to your PC.
  2. Search for “file history” in Windows Search (Windows Key + S). Click on the Restore your files with File History option.
  3. Locate the folder that contained the deleted files and cycle through the backups until you find one which has the required files.
  4. Select the files and click on the green restore button to get back the files.Windows File History screen.

On macOS, you can use the Time Machine app to restore your files:

  1. Ensure the drive containing the Time Machine backup is connected to your Mac.
  2. Look for “time machine” in Spotlight Search (Command + Space) and open the app.
  3. Find the folder which contained the deleted files. Use the navigation buttons on the right side of the screen to cycle through the backups.
  4. Once you find the backup containing the required files, select the files and click Restore.Time Machine in macOS.

Method 4: Use the Command Prompt or Terminal to Undo Deletion

There are certain commands you can use in Windows, and macOS to undo deletion and remove certain attributes that may have made your files invisible. To execute these commands, you’ll need to use the Command Prompt (Windows).

Here’s how to undo deletion using the Command Prompt (CMD) on Windows:

  1. Search for “cmd” in Windows Search (Windows Key + S). Right-click on Command Prompt from the search results, and choose Run as Administrator.
  2. In the CMD console, type attrib -h -r -s /s /d X:*.* and press Enter. Replace X with the drive letter or partition letter where the files were originally located.Attrib command in Windows.
  3. Open Windows Explorer (Windows Key + E) and check if the files have reappeared.

On macOS, use the Terminal to undo deletion:

  1. Type “terminal” in Spotlight Search (Command + Space) and open the Terminal app.
  2. Type cd .Trash and press Enter.CD Trash command in macOS.
  3. Type ls -al ~/.Trash and press Enter. Look for the file you wish to undo deletion for.Is Al command in macOS.
  4. Type mv filename ../ and press Enter. Replace filename with the file you wish to get back. The file will be restored to the home directory.Mv filename command in macOS.


Accidents happen, and it’s easy to accidentally delete files you didn’t intend to. Luckily, both Windows and Mac have measures in place that let you undo what you deleted and recover your files. The methods to do this range from simply using the undo feature on the operating systems, or resorting to command line tools to help you out.

If you’re unable to undo deletion, you can always use a good data recovery program like Disk Drill to recover your files.


The best way to find something you just deleted, is to check the Recycle Bin (Windows), or Trash (macOS). If the file isn’t there, you can always use data recovery tools to get it back.
You can use the CTRL + Z combination on Windows to undo the last action you did, such as deletion. On macOS, the equivalent key combo is Command + Z.
No. The deleted documents will first go to the Recycle Bin or Trash on Windows and macOS respectively. If those locations are emptied manually or automatically, then, too, technically they’ll still be there on your drive until new data overwrites them. But, if you perform a full format on the drive, or new files take their place, the documents will be gone for good.
Android doesn’t have a native undo or Recycle Bin-like feature. However, most Android file managers come with a dedicated trash folder that stores deleted files until they’re restored, or further deleted from the folder. It’s best to refer to the user guide of the file manager app you’re using.
Manuviraj Godara is a professional content writer with over 4 years of experience under his belt. His ever-growing fascination and experience with technology drives him to create content related to data recovery and consumer technology.
Approved by
12 years experience in software development, database administration, and hardware repair.