Recover Quarantined Files from Windows Defender
In this article
If Windows Defender has quarantined a file you believe is safe, you can restore it through the Windows Security app in a few clicks. This article explains exactly how to recover quarantined files, what quarantine does, and how to avoid future false positives.
What Quarantine Does in Windows Defender
Quarantine is a protective holding area where Windows Defender (officially Microsoft Defender Antivirus) stores files it detects as malicious or suspicious. The files are encrypted and moved to a system folder, so they cannot execute or harm your PC. This happens automatically when real-time protection is on, and you can also manually quarantine items from a scan. Quarantine is not deletion: the file remains on your disk, but it is inaccessible until you restore or remove it.
How to Restore a Quarantined File (Step by Step)
- Open the Windows Security app. You can search for it in the Start menu or double-click the shield icon in the system tray.
- Select Virus & threat protection in the left sidebar (or the main window).
- Under the “Current threats” section, click Protection history. This shows all recent actions, including quarantined items.
- Find the file you want to recover. It will be listed with a status like “Quarantined” and the threat name (e.g., Trojan:Script/Phonzy.A).
- Click the drop-down arrow on the right side of the item, then select Restore.
- Confirm the action in the dialog that appears. The file is returned to its original location.
If you do not see the file in Protection history, it may have been deleted automatically after a period (usually 30 days) or removed by a cleanup action. In that case, you will need to recover it from the Recycle Bin or a backup.
What to Check Before You Restore
Restoring a file that is actually malicious can infect your system. Before you click Restore, verify the following:
- Source of the file: Did you download it from an official website or receive it from a trusted colleague? If it came from an unknown email attachment or a random pop-up, treat it as dangerous.
- Threat name: Defender labels detections with categories like “Trojan,” “Ransomware,” or “PUA” (Potentially Unwanted Application). A PUA is often benign, but a Trojan is almost never safe.
- File type: Executable files (.exe, .dll, .scr) are riskier than documents or images. A false positive is more common for a small utility you wrote yourself than for a downloaded installer.
- Digital signature: Right-click the file (if you can access it via the original path) and check Properties → Digital Signatures. A valid signature from a known company is a good sign.
If you are unsure, leave the file in quarantine or delete it. You can upload it to a service like VirusTotal (a free website that scans files with many antivirus engines) to get a second opinion, but do so only if you are comfortable sharing the file.
How to Add an Exclusion to Prevent Future Quarantine
If the file is safe and you need it to run, you can add an exclusion so Windows Defender ignores it in the future. Exclusions are powerful and should be used sparingly, as they can open security holes.
- In Windows Security, go to Virus & threat protection.
- Under “Virus & threat protection settings,” click Manage settings.
- Scroll down to Exclusions and click Add or remove exclusions.
- Click Add an exclusion and choose the type: File, Folder, File type, or Process.
- Browse to the file or folder you want to exclude and select it.
Be precise: exclude only the specific file or folder you trust, not an entire drive. Also note that exclusions apply to real-time scanning, but a manual scan may still flag the item unless you also exclude it there.
Common Reasons for False Positives
False positives happen when antivirus software mistakes a legitimate file for malware. Common triggers include:
- Packed or compressed executables: Programs that use packers (like UPX) to reduce size can look suspicious.
- New or rare software: A program with few downloads or no digital signature is more likely to be flagged.
- Behavioral detection: A file that modifies system settings or other programs may be flagged even if it is a legitimate installer.
- Heuristic analysis: Defender uses heuristics to guess if a file is malicious based on code patterns. This can occasionally be wrong.
- Keygens and cracks: These are often flagged as “HackTool” or “PUA.” Even if they work, they are risky and may contain real malware.
What If Restore Fails or the File Is Missing?
Sometimes the Restore button is grayed out or the file does not appear in Protection history. Here are a few things to try:
- Run a full scan to ensure the threat is still present. If it is gone, Defender may have already removed it.
- Check the Recycle Bin: If the item was deleted (not quarantined), it may be there.
- Use File History or a backup: If you have system restore points or a backup service, you can recover the original file from there.
- Restart the Windows Security app: Close and reopen it, or restart your PC, then check Protection history again.
- Use PowerShell (advanced users): You can list and restore quarantined items with the
Get-MpThreatDetectionandRemove-MpThreatDetectioncmdlets, but this requires administrative rights and careful handling.
Frequently Asked Questions
Will restoring a quarantined file re-infect my PC?
It can. If the file is genuinely malicious, restoring it will bring the threat back. Always verify the file’s source and threat name before restoring. If you are not sure, keep it quarantined or delete it.
How long does Windows Defender keep quarantined files?
By default, Windows Defender keeps items in quarantine for 30 days, after which they are automatically deleted. You can change this in the Windows Security settings under “Protection history” by adjusting the “Retention period” (in some Windows versions).
Can I restore a file that was deleted by Defender, not quarantined?
If Defender deleted the file, it is not in quarantine. You can try the Recycle Bin, but if it was a system-level deletion, you may need a backup or file recovery tool. In the future, you can add an exclusion before scanning to prevent deletion.
Why did Windows Defender quarantine a file I downloaded from a trusted site?
Even trusted sites can be compromised, and files can be altered. Defender may also flag a legitimate file due to a false positive. Check the file’s digital signature and scan it with another tool if needed.
Is it safe to add an exclusion for a folder?
It is safe only if you are certain the folder contains no malware. Excluding a folder means Defender will not scan any file inside it, including new files added later. Use folder exclusions only for directories that are known to be clean, like a development folder for your own code.
What is the difference between “Restore” and “Restore and add an exclusion”?
In some Windows versions, the Restore option may offer to also add an exclusion for the file. This prevents Defender from flagging it again. If you choose this, the file is restored and added to the exclusion list automatically. If you only restore, it may be re-quarantined on the next scan.