Undo DiskPart Clean: Recover Data/Partition after DiskPart Clean

Don't worry if DiskPart clean command deleted data and partition on Windows 11/10/8/7. First, you need to stop using the hard drive or external device. Next, you need a reliable DiskPart clean recovery method for help. Here, EaseUS diskpart recovery software with the other 2 methods will bring your lost data and partition back instantly.

 Download for Win Recovery Rate 99.7%
 Download for Mac Trustpilot Rating 4.4

Table of Contents

Many people complain that their data and partition got deleted mistakenly as they run the DiskPart clean command on a wrong drive but don't know how to undo DiskPart clean.

If you are with the same issue, check out the content navigation. You'll find three practical methods to recover data and partition deleted by DiskPart clean command on Windows 11/10/8/7 with ease: 

Note: Stop using your hard drive and don't save any new data once you've cleaned the disk using diskpart. 

DiskPart Clean Overview

In this part, you'll learn: 1. What is Diskpart clean command; 2. When to use it. 

DiskPart clean

DiskPart.exe is a disk utility in Windows that helps Administrators manage a computer's disk partitions with some commands.

DiskPart clean is a command that overwrites the partitioning information, including hidden sector information or the Protective MBR, on an MBR or GPT Disk. As a result, the command removes all partitions or volumes formatting from the disk. That's why you see data and partition lost after executing this command. 

Unlike DiskPart clean, the clean all command is set to write zero to each and every sector on the disk, which completely deletes all data on the disk. It's a way to erase a drive, making data and partition unrecoverable.

As explained, both Diskpart clean and clean all commands will cause serious data loss. It is not suggested to execute frequently as it's a "dangerous" command. So when should you use the DiskPart clean command? 

  • DiskPart clean - Use it when you want to clean a whole drive, it has some errors, or you want to free up disk space for other purposes.
  • DiskPart clean all - Use it when you want to erase the drive or sell the drive, etc.

IMPORTANT: Be more careful while cleaning the drive with this command, your data will be removed. And it can happen at times. 

Can You Undo Diskpart Clean and Recover Files

Can you recover files after Diskpart clean? The answer to this and other similar questions is YES. It's possible to undo the DiskPart command. 

Sometimes, users may execute a wrong command in their storage devices or Windows hard drive partition, accidentally deleted data or deleted the partition by mistake. 

As explained, the DiskPart clean command only deleted data and partition. Therefore, you can still recover files and partitions after DiskPart clean. However, if you executed "clean all" command, undoing diskpart clean in that situation is impossible. 

You may come up with the next question of "How do I restore a partition using diskpart" or "How do I undo a clean command in Diskpart", right?

Follow the methods in the next part, you can undo the operation and bring your data and partition back immediately.

How to Undo Diskpart Clean in Windows 11/10/8/7 ( 3 Ways)

Now you know the files and partitions are recoverable if you use the diskpart clean command without the "all" parameter. Here, we collected 3 practical methods that can help you recover files and partition on your drive with ease:

  1. #1. Recover DiskPart Cleaned Data and Create New Volume - Safe & Sound
  2. #2. Use Partition Recovery Tool - Easy
  3. #3. Turn to Manual Partition and Data Recovery Service

Solution 1. Run EaseUS DiskPart Recovery Software 

Applies to: 3-step data recovery, recover lost partition with DiskPart command.

One of the practical ways that you can try is to run a reliable DiskPart recovery software to restore lost data first. Then run the CMD command to create new volumes on the drive.

#1. Recover DiskPart Cleaned Data via EaseUS DiskPart Recovery Software

Professional hard drive recovery software - EaseUS Data Recovery Wizard is designed to scan and retrieve the files and folders from your disk from any data loss situations.

With it, you can undo diskpart clean in Windows 11/10/8/7 and even earlier versions with simple clicks. 

 Download for Win Recovery Rate 99.7%
 Download for Mac Trustpilot Rating 4.4

Follow to recover your lost data in 3 steps:

Step 1. Select a drive to scan

To start recovering DiskPart deleted files, you must determine where the files were kept before deletion. EaseUS Data Recovery Wizard will list all the loaded drives on your PC, so it's for you to select the correct drive to scan. Hover the mouse pointer to the drive and click "Scan".

select a location and click scan

Step 2. Check for scanned results

The scan process takes place at two stages: A quick scan and deep scan. Deep scan usually takes longer time but it's worth waiting, which is supposed to find many more files that lost file names. You can click "Filter" to display only the specified file formats, such as pictures, videos, Word documents, PDF files, etc. You can also search a file or folder using its name in the "Search" box.

filter wanted files

Step 3. Preview and recover

Once located the desired files that were deleted by DiskPart, you can double-click the files one by one for preview, or use the "Preview" button to check its integrity. At last, click "Recover". You shall choose a different drive to save the recovered files to avoid data overwriting.

recover diskpart deleted files

Remember to save the found data to another secure location. Then follow the next tutorial to make the DiskPart cleaned drive usable again.

#2. Partition Recovery - Create New Volumes via Diskpart

Now, you can perform partition recovery on your hard drive, USB, or external hard drive with DiskPart.

The command is not a recovery command but you can use it to create new partitions on the drive, making the cleaned drive or USB, SD card usable again:

Step 1. Press Windows + R keys, type cmd in the Run dialogue, and hit Enter. 

Step 2. Type below commands, hit Enter each time to create a new partition:

  • diskpart
  • select disk * (Replace * with the disk number of your drive.)
  • create primary partition size=* (Replace * with the partition size.)
  • assign letter=* (Replace * with a new drive letter.)
  • exit

 Create new partition on Diskpart cleaned drive

If you want to create more than one partition on your hard drive, just repeat the above process.

After this, you are good to use the drive or external storage devices and you may save the restored data back to the device again. 

Solution 2. Use Partition Recovery Tool 

Applies to: Recover partition and data together from a DiskPart cleaned drive.

If you want to recover both data and the partitions on the disk, which was cleaned by DiskPart, you can use EaseUS Partition Recovery to get things done. It is exclusively designed for partition and data recovery.

Note that sometimes, if the partition table gets corrupted, a normal partition recovery tool may not be able to detect nor find your lost disk partition. So it is to EaseUS Partition Recovery. In this case, you'll need to revert to Solution 1 and apply data recovery software for help. 

Follow the steps here to restore partitions and files from the disk on which you use the diskpart clean command:


Step 1: Run EaseUS Partition Recovery on your PC.

Select the disk or device where you lost partition(s), click "Scan" to continue.

Select disk to scan lost partition.

Step 2: Wait for the scanning process to complete.

Let the program scan the selected disk and find the lost partition(s).

Scan lost partition.

Step 3: Preview and restore the lost partition(s).

Double-click on the partition which is marked as "Lost" with "Good" recoverability.

Preview lost partition

Preview the content of the lost partition. Click "OK" and click "Proceed" to start restoring the lost partition.

Select found partition to restore.

Step 4: Click "Recover Now" to finish the partition recovery process.

Note: If the program warns you that there is a conflict, back up the listed partition with essential data to an external hard drive first. Then execute the final operation to restore your lost partition.

Finish partition recovery.

#3. Turn to Manual Partition and Data Recovery Service

Applies to: Manually undo DiskPart clean, restore data, and partition on a hard drive from a third-party data recovery service.

Note that if the above two methods fail to help you undo the DiskPart clean command, there might be more problems on your disk. And you can turn to a manual partition and data recovery service for help.

Do You Need Specialized Data Recovery Services?
You may need further help for tough data loss situations like reformatting drive, RAW disk, partition loss, repartition failures, and system boot error. Consult with EaseUS Data Recovery Experts for cost-efficient one-on-one manual recovery service. They could offer the following services after FREE diagnosis:
1. Unformat the drive
2. Repair the RAID, RAW disk or operating system
3. Recover lost partition (the one that cannot be recovered by software)

The Bottom Line

On this page, we explained what is DiskPart clean command and the difference between "clean" and "clean all" commands. When you executed a solely clean command on your drive, you may still bring the lost data and partition back.

If you want to undo the DiskPart clean command. First, don't make any changes to your drive. Next, turn to a reliable method for help. If you only used "diskpart clean",  you can recover all your data and partitions using a partition recovery tool, EaseUS DiskPart recovery software, or data recovery service.

 Download for Win Recovery Rate 99.7%
 Download for Mac Trustpilot Rating 4.4

Last, it's also recommended that you make a regular backup of all valuable files on your drive to another secure location. 

Was This Page Helpful?

Updated by Daisy

Daisy is the Senior editor of the writing team for EaseUS. She has been working in EaseUS for over ten years, starting from a technical writer to a team leader of the content group. As a professional author for over 10 years, she writes a lot to help people overcome their tech troubles.

Read full bio

Written by Tracy King

Tracy joined in EaseUS in 2013 and has been working with EaseUS content team for over 7 years. Being enthusiastic in computing and technology, she writes tech how-to articles and share technical solutions about Windows & Mac data recovery, file/system backup and recovery, partition management and iOS/Android data recovery.

Read full bio

Product Reviews

TrustScore 4.7 | 323 reviews
  • EaseUS Data Recovery Wizard is a powerful system recovery software, designed to enable you to recover files you’ve deleted accidentally, potentially lost to malware or an entire hard drive partition.

    Read More
  • EaseUS Data Recovery Wizard is the best we have seen. It's far from perfect, partly because today's advanced disk technology makes data-recovery more difficult than it was with the simpler technology of the past.

    Read More
  • EaseUS Data Recovery Wizard Pro has a reputation as one of the best data recovery software programs on the market. It comes with a selection of advanced features, including partition recovery, formatted drive restoration, and corrupted file repair.

    Read More