How to Undo Diskpart Clean: 2 Easy Methods

Try the data recovery as soon as possible after Diskpart clean

Reading time icon 3 min. read

Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team Read more

Key notes

  • The Diskpart clean command can erase the data on the selected disk.
  • It is possible to recover the partitions on Windows devices without threatening the system.
  • You might recover the partition using the Command Prompt immediately.
undo diskpart clean

Diskpart is a command-line utility that allows you to manage your computer’s storage devices. However, people may accidentally execute the Diskpart clean command erasing all data on the selected disk. If you are in this situation, we will explore how to undo Diskpart clean and recover your partition.

Alternatively, you can read about how to fix there is no fixed disk to show in Diskpart on Windows.

Can you recover files after a Diskpart clean?

It is possible to recover files after a Diskpart clean, but it depends on the extent of the damage done to the disk. When you run the clean command in Diskpart, it removes all partition and volume information from the selected disk, wiping it clean.

However, some data recovery tools help you recover lost files. Additionally, if you had previously created a backup of the disk, you may be able to restore your lost files via the backup.

Furthermore, it’s worth noting that the chances of successfully recovering data after a Diskpart clean are not guaranteed and will depend on factors such as the severity of the damage and how soon you attempt to recover the data.

How can I undo a Diskpart clean?

Apply the following before proceeding with advanced troubleshooting:

The following check will aid in undoing the erased partition.

1. Undo Diskpart clean via Command Prompt

  1. Right-click the Start icon, and click on Run. Type diskmgmt.msc and press Enter.
  2. Locate your deleted partition and remember its size. The deleted partition will be an unallocated space.
  3. Press the Windows key, type cmd, and select Run as Administrator from the right pane.
  4. Type the following in the Command Prompt and press Enter: diskpart
  5. Then, input the next command and press Enter to show the disk partition: list disk
  6. Input the next command and press Enter: select disk X
  7. Type the following in the Command Prompt and press Enter: list volume
  8. Next, input the line and press Enter (Y signifies the number of the lost partition): select volume Y
  9. Lastly, type the following and press Enter (H signifies the drive letter that is unallocated): assign letter H

The steps will undo the Diskpart clean command on Windows 11 PC and restore the deleted data. Check our guide on how to fix Command Prompt not working on your PC.

2. Via the third-party app

You can recover Diskpart clean using a third-party partition tool. Most third-party software tools available in the market are free, although you can get paid ones as well for more efficiency.

We have a recommended list of the best file recovery software for Windows 11 here. Do not hesitate to check it out.

In addition, you can read how to recover unallocated partitions with simple steps. Also, our guide about the best partition manager software on Windows devices has proven helpful for some of our readers who encountered the issue.

For further questions and suggestions, kindly drop them in the comments section.

More about the topics: DiskPart