Skip to content

Clean up duplicate files on Windows without deleting them: a review folder and undo

Deleting duplicates leaves little room to undo a mistake. How to move the extra copies aside with a list of where each came from, and put them back if needed.

We make Duplicate File Finder, the app this guide uses. The free methods come first; every step shown in Duplicate File Finder was checked in the app itself, and the screenshots come from the real app with invented sample data.

Short answer

Move the extra copies to a review folder, with a list of where each one came from, and delete that folder only when you are sure. PowerShell can do this with a file hash, a log and a one-line undo: we ran it below. Duplicate File Finder does it with rules for which copy to keep, a byte-for-byte check right before each move, and a history to undo a batch. Deleting at once, even to the Recycle Bin, leaves less room to recover from a mistake.

Why move the copies instead of deleting them

Many duplicate finders delete the extras or send them to the Recycle Bin, and the Recycle Bin is not always there to catch them: Cisdem's guide, for one, says its app sends duplicates to the Recycle Bin by default, but that on Windows large files are removed permanently, and so are files deleted from external storage; the same guide also offers a Move to Folder method. Free tools can move too: dupeGuru has Move Marked to... next to Send Marked to Trash, and Czkawka's Krokiet lists a move action beside delete and trash. We did not run either for this guide.

A review folder keeps every option open: you can open the moved files, check the programs that used them, such as a photo library or a backup job, and put them back. Moving a file to another folder of the same drive gives no space back by itself; the space returns when you delete the review folder.

Method 1 (free): PowerShell, a hash, a review folder and a log

Windows PowerShell 5.1, built into Windows 10 and 11, has Get-FileHash, which computes a SHA-256 of each file: Microsoft's documentation notes that files with the same hash have the same content. The lines below, run from the folder to search, group files of 10 KB and more by hash, keep one copy per group (a copy in its Pictures folder if there is one, otherwise the first path in alphabetical order) and move the others with Move-Item to a Duplicates review folder beside the searched folder, writing each move to moved.csv as it goes. We ran them on 30 November 2026 (Windows PowerShell 5.1, Windows 11) on invented sample folders: Pictures, an old laptop backup, a phone import and Downloads, 17 files in all. Run them only on a folder of your own files, such as photos or documents, never on the root of your system drive, your whole user folder, Program Files or AppData.

& {
    $root   = (Get-Location).Path
    $keep   = (Join-Path $root 'Pictures') + '\'                          # a copy in here is preferred as the one kept
    $review = Join-Path (Split-Path $root -Parent) 'Duplicates review'    # outside the searched folder
    $log    = Join-Path $review 'moved.csv'
    $groups = Get-ChildItem -Recurse -File |
        Where-Object Length -ge 10KB |
        Get-FileHash -Algorithm SHA256 |
        Group-Object Hash | Where-Object Count -gt 1
    New-Item -ItemType Directory -Path $review -ErrorAction Stop | Out-Null   # stops if the folder is already there
    $n = 0
    foreach ($g in $groups) {
        $sorted = @($g.Group | Sort-Object { -not $_.Path.StartsWith($keep, 'OrdinalIgnoreCase') }, Path)
        foreach ($extra in $sorted | Select-Object -Skip 1) {
            $n++
            $target = Join-Path $review ('{0:D3} {1}' -f $n, (Split-Path $extra.Path -Leaf))
            Move-Item -LiteralPath $extra.Path -Destination $target -ErrorAction Stop
            [pscustomobject]@{ Moved = $target; From = $extra.Path; Kept = $sorted[0].Path; SHA256 = $g.Name } |
                Export-Csv -LiteralPath $log -NoTypeInformation -Append
        }
    }
    "{0} groups, {1} files moved to '{2}'" -f @($groups).Count, $n, (Split-Path $review -Leaf)
}
6 groups, 8 files moved to 'Duplicates review'

moved.csv lists, for each file, its new name in the review folder, where it was, the copy kept and the SHA-256. The & { } around the lines makes PowerShell run them as one block, even when they are pasted into the window, so an error stops everything after it. Run them once: a second run stops before moving anything because Duplicates review is already there, as it did in our test. This line, run from the same folder, moves everything back:

Import-Csv -LiteralPath '..\Duplicates review\moved.csv' |
    ForEach-Object { Move-Item -LiteralPath $_.Moved -Destination $_.From }

After the undo, the 17 files were back in place and the review folder held only moved.csv. What the lines do not do showed up in the same test:

  • Which copy is kept is a sort. Outside Pictures, the first path wins: the script kept Downloads\Tax return 2025 (1).pdf, the copy with (1) in its name, and moved the backup's Tax return 2025.pdf. If two copies are both in Pictures, only one is kept; the other is moved like any extra. Change the $keep line, or the sort, to suit your folders.
  • Nothing is compared again before a move. The files are moved right after hashing; a file changed in between would still be moved.
  • A hard link is one file with two names. The backup held Rome 002.jpg under two names (fsutil hardlink list shows both); the script moved both as two copies, which overstates what deleting them would give back.

Method 2: keep rules, a check before each move and undo with Duplicate File Finder

Duplicate File Finder is our Windows app for this job. It compares files by their content, not their names, across your folders, groups identical copies, and lets you choose which copy to keep with rules or by hand. The extras are moved to a review folder, never deleted, and each batch can be undone from its history. It works offline. The screenshots below come from version 1.0.0 (evaluation build) with the same kind of invented folders.

  1. Add the folders and give one the Keep all role. We added the four folders and set Pictures to Keep all: nothing there is ever moved. Copy to keep: In the folder highest in the list decides the other groups, and Files of 10 KB and larger skips small files.
  2. Search and read the groups. Each group lists its copies, the action for each and the reason, with a picture preview and the SHA-256. In our test: 6 groups, 7 extra copies, 8 files to move aside, 4.0 MB to get back. The eighth file is the second name of the hard-linked Rome 002.jpg, moved with it but counted apart: "other names of a file already found, not counted as copies". Keep this copy, Move this copy and Keep only this copy change a group by hand: in our test we chose Keep only this copy for the Downloads copy of Holiday videos.zip, and the rule decided the other groups.
  3. Move extras aside. Right before each move, the file is compared byte for byte with the copy that is kept. In our test a phone photo was edited after the search, and it was left in place: "7 file(s) moved, 4.0 MB · 1 left in place". The moved files go to a subfolder named with the date and time, inside a Duplicates moved aside folder in each searched folder that had extras, with moved files.csv (every file, the copy kept, its SHA-256) and a READ ME.
  4. Undo from the history if needed. History lists each batch with every old and new path; Undo this batch puts each file back at its old place, if it is still the same file and the place is free.
Duplicate File Finder after a search of four folders: 6 groups, 7 extra copies, 8 files to move aside, 4.0 MB to get back; the Rome 001.jpg group keeps the copy in the Keep all Pictures folder and moves two others.
Groups of identical files, with the copy to keep and why. Duplicate File Finder 1.0.0 (evaluation build), tested 30 November 2026, invented sample files.
The Extra copies moved aside window: 7 files moved, 4.0 MB, 1 left in place because it changed since the search; the files are in Duplicates moved aside folders with moved files.csv and a READ ME.
A file changed since the search stays where it is. Duplicate File Finder 1.0.0 (evaluation build), tested 30 November 2026, invented sample files.
The History window: one batch of 7 files and 4.0 MB from 4 folders, done, with each file's old path and new path and the Undo this batch button.
Every batch can be put back from the history. Duplicate File Finder 1.0.0 (evaluation build), tested 30 November 2026, invented sample files.
How to Find Duplicate Files on Windows and Free Up Disk Space0:59Watch on YouTubeNothing loads from YouTube until you press play. The player then loads from youtube-nocookie.com, YouTube's privacy-enhanced mode, and connects to Google's servers. Privacy

When to empty the review folder

  • Open a few moved files, and run the programs that used the folders you searched: a photo library, a backup job, a project that links to its files.
  • Keep the folder for as long as that takes; the list in it tells you where each file came from if one is missed.
  • Then delete the review folder. That is the step that gives the space back, and the one to do last.

Limitations

  • The PowerShell lines keep a copy by path order, do not compare files again before moving them, and count a hard link as two copies; they read every file of 10 KB and more in full to hash it.
  • Duplicate File Finder finds identical files. A photo saved again at another size is a different file to it: our guide to finding resized duplicate photos covers those.
  • Duplicate File Finder moves files and never deletes them; deleting the review folder is up to you. It searches up to 20 folders. Its planned requirements: Windows 10 (22H2) or 11, 64-bit.

References