To recover files after a ransomware attack, first disconnect the infected PC from the network and any backup drives, then remove the ransomware or reinstall Windows, and finally restore clean copies of your files from a backup made before the infection. Paying the ransom is risky and often does not work. If you have no clean backup, check for a free decryptor for your ransomware strain and look at older copies Windows or your cloud storage may have kept.
Work through the steps below in order. Rushing to restore files onto a PC that is still infected is the most common way to lose your backup as well.
Step 1: stop the damage spreading
Ransomware keeps encrypting while it runs, and it will reach any drive or network share it can write to. Act quickly:
- Disconnect from the network. Unplug the network cable and turn off Wi-Fi. This stops it spreading to other PCs and shared folders.
- Unplug external drives and backup drives. If your backup drive is connected, remove it now. Do not reconnect it until the PC is clean.
- Do not delete the ransom note or encrypted files yet. You may need them to identify the strain or to try a decryptor later.
- Take a photo of the ransom note with your phone, including any file extension the ransomware added.
- Check other devices. If you have a NAS or shared drives, look for encrypted files there too.
If this is a business PC, tell whoever handles IT or security now, and consider reporting the attack. In the US, the FBI's Internet Crime Complaint Center accepts reports, and other countries have similar agencies.
Step 2: find out when it started
The key question for recovery is: when was the last moment your files were clean? Look at:
- The modified dates on encrypted files in File Explorer. The earliest one is roughly when encryption began.
- When you first noticed odd file names or extensions, or files that would not open.
- Any suspicious email attachment, download or remote access you remember from before that.
Some ransomware sits quietly for days before encrypting. To be safe, plan to restore from a backup taken a day or more before the earliest sign of trouble.
Step 3: clean the PC
Never restore files onto a PC that may still be infected. You have two options:
- Scan and remove. Run a full scan, then a Microsoft Defender Offline scan: open Windows Security → Virus and threat protection → Scan options → Microsoft Defender Antivirus (offline scan) → Scan now. The PC restarts and scans before Windows loads.
- Wipe and restore. The safest route is to erase the drive and start again, either by reinstalling Windows or by restoring a system image taken before the infection.
If you have a clean system image, restoring it is often quicker than reinstalling Windows and every program. Boot from your rescue USB or recovery drive, restore the image, and you have Windows and your programs back as they were before the attack. Then bring your files up to date from your most recent clean file backup.
Step 4: restore your files from backup
Once the PC is clean, reconnect your backup drive and restore. Which backup you use matters:
| Backup type | Likely state after ransomware |
|---|---|
| Drive that was disconnected during the attack | Safe. Use this first. |
| Drive that was connected, with versioned backups | Latest versions may be encrypted, but older versions are usually intact. |
| Simple copy or mirror (no versions) | Probably overwritten with encrypted files. |
| Cloud sync folder (OneDrive, Dropbox) | Encrypted copies synced, but version history or a restore feature may help. |
| NAS share mapped as a drive letter | Often encrypted too. Check snapshots if your NAS has them. |
With version history, the process is: pick a date before the infection, browse the backup, and restore. In Rocket Backups you choose a point on the timeline, such as the night before the attack, browse to the folders you need and restore them to where they were or to a new folder. Restoring to a new folder first lets you check the files open properly before you replace anything.
With File History, open Control Panel → File History → Restore personal files, use the arrows to go back to a date before the infection, select the folders and click the green restore button.
Check a sample of restored files in each important folder, especially documents, spreadsheets and photos, before you delete the encrypted copies.
No clean backup? Things to try
If you do not have a usable backup, your options are limited, but not always zero:
- Free decryptors. The No More Ransom project, run by law enforcement and security companies, publishes decryptors for some older strains. Search for it using the ransomware name or extension.
- Cloud version history. OneDrive keeps previous versions of files and, for Microsoft 365 subscribers, offers a Restore your OneDrive feature that rolls the whole OneDrive back to an earlier date.
- Previous Versions. Right-click a folder, choose Properties → Previous Versions. Most ransomware deletes these shadow copies, but it is worth a look.
- Email and other copies. Attachments you sent, files on a phone, or copies on a work PC may cover the most important items.
Paying the ransom is discouraged by law enforcement. There is no guarantee the decryptor works, you may be targeted again, and in some cases payments to sanctioned groups are illegal.
Make the next attack a minor problem
The difference between a lost week and a lost hour is a recent backup that ransomware could not reach. Set up these protections now:
- Versioned backups, so you can go back to before an infection even if recent backups were affected.
- A copy that is disconnected between runs, such as a USB drive that is only plugged in for the backup.
- Encryption on backups, so a stolen drive does not leak your data.
- Controlled folder access in Windows Security, which blocks unknown apps from changing files in protected folders.
Rocket Backups covers the backup side of this: scheduled, versioned and AES-256 encrypted backups, with the option to send each one to two places, such as a USB drive and a NAS. Our guide to protecting your backups from ransomware walks through the full setup, and the 3-2-1 backup rule explains why two copies in two places matter.
Frequently asked questions
Should I pay the ransom to get my files back?
Law enforcement agencies advise against paying, because there is no guarantee you will get a working decryption key. A clean backup is the reliable way back.
Can ransomware encrypt my backup drive too?
Yes, if the drive is connected and writable when the ransomware runs. Keep at least one backup copy on a drive that is disconnected between backups, or on separate storage.
How do I know which backup version is clean?
Find when encrypted or renamed files first appeared, then restore from a backup taken before that date. Check a few restored files open normally before restoring everything.
