> How to > Data Recovery Solution > Recover Data after Accidentally Cleaning Disk Using Diskpart

Recover Data after Accidentally Cleaning Disk Using Diskpart

Updated on Nov 02, 2018 by Abby Haines to Data Recovery Solution


This page tells how to recover data when you accidentally cleaned disk using DiskPart and show you the right way to undo the disk clean using cmd. Read and see how can you restore lost data and disk partition with ease.

Diskpart, a Windows built-in free command line tool designed for disk managing which you won't miss as a PC user. One of its most frequently used features is the clean command with which you can wipe a disk with just one click. But sometimes, you may accidentally clean a hard disk and wipe all your data. As a result, all your data and partitions will be fully removed. 

Lost data and partition after running DiskPart clean command

If you are facing such a problem, you may be interested in how to rescue your important files and undo the disk clean command. If so, read on to get your solution.

Restore data lost by DiskPart clean command
Undo DiskPart clean using cmd

How to restore lost data with data recovery software

Diskpart disk clean command remove all data.

DiskPart clean command will remove the whole disk partitions and all existing data no matter you selected to clean a simple volume or a whole disk.
1. If you only ran 'Clean' command, it will remove all partition and data. Mostly, Diskpart clean recovery is possible.
2. If you've executed 'Clean All', this command will thoroughly erase all data and destroy partitions on the disk.

Therefore, please make sure that you've run 'Clean' command not 'Clean all' command before you try the provided data recovery solution here.

So, what tool can recover the removed data from cleaned disk? Our advice is to try EaseUS data recovery software.

Therefore, please activate this software to gain unlimited data recovery capacity before you start the process. Of course, you can also try the free edition - EaseUS Data Recovery Wizard Free, if your disk data is less than 2GB.

And under this circumstance, activation will be a wise decision for a smooth hard disk data recovery process.


EaseUS Data Recovery Wizard

Restore unlimited lost files now


Click to Activate

-$20 Now



 It can deep scan the Diskpart cleaned hard drive to find and recover all the removed data in just 3 simple steps.

To recover deleted data:

First, choose a location to scan
Second, quickly display the deleted data
Third, preview data and then recover

Let's learn the detailed steps:

Step 1. Choose a location

Just make it clear where the data was deleted. Choose this drive and click the Scan button.

select a location

Step 2. Check the quick scan result

It takes several minutes for the software to find deleted contents, and it will put the result in "Deleted files". You can recover the deleted data as soon as it appears in the result.

select data and click recover

Step 3. Preview data and recover

A double-click on a file allows you to preview. Select the wanted data and click "Recover".

scan deleted data

Undo DiskPart clean using cmd (to restore lost partitions)

So some of you may want to know is it possible to undo the DiskPart clean command and restore lost partitions? Sure!

Here we'll show you how to use command lines to restore all your lost partitions:

Step 1: Open CMD and type: diskpart and hit Enter.

Step 2:  Type: list disk and hit Enter.

Step 3: Type: select disk 2 (replace 2 with the disk number on which you lost data) and hit Enter.

Step 4: Type: list volume and hit Enter.
Step 5: Type: select volume 4 (and replace 4 with the partition number on which you lost data due to diskpart clean command) and hit Enter.

Step 6: Type: assign letter=d (replace d with the drive letter that you want to add to the cleaned partition) and hit Enter.

Step 7: Repeat 5 and 6, and assign each partition with a different drive letter. 

Step 8: Exit and then all your partitions on the cleaned disk are all back.

Undo DiskPart clean disk command and restore partition.

DiskPart clean command can easily cause data loss and partition loss issue on your disk, please be very careful and make sure that all essential data on your disk has been backed up before executing this command.

And once you lost data and disk partitions with DiskPart clean command, follow provided methods on this page for help.

If you run a delete command in DiskPart, please apply EaseUS Data Recovery Wizard to retrieve deleted files.