Ans: Recover files after a virus by scanning with an updated antivirus and restoring from backup or data recovery software.
How to Recover Files After Virus Attack?
If a virus attacks your system, the priority is to isolate the machine to prevent further damage. Then, perform a deep, updated antivirus scan to remove the threat. Once cleaned, you can recover data from backup, File History or folders, or use secure data recovery software. This article provides a detailed guide on how to recover files after virus attack, with methods and steps explained.
Quick Answer: If a virus attacks, immediately disconnect from the internet to prevent further damage and run a full antivirus scan. To recover files effectively, restore from recent backups first; otherwise, use robust data recovery software such as Notchox to restore encrypted or deleted files and remove hidden attributes.
How to Recover Files After Virus Attack?

- Isolate and Clean: Disconnect the machine from the internet and stop using it to prevent further damage, as a virus can spread instantly. Run a full system scan using a reliable antivirus software.
- Unhide the Hidden Files (CMD): Many viruses may hide your files instead of deleting them, because encryption takes a long time.
- Restore From Backup: If available, download backup data from Windows File History or Cloud storage.
- Use Data Recovery Software: If your data is encrypted by malware or seems deleted, use specialised recovery tools like Notchox to scan and restore the lost data.
- Check File Extensions: Some viruses may rename files. Search for unknown extensions and rename them to their original format.
- Scan Drives for Errors: Running the chkdsk command scans your hard drive and repairs errors, recovering readable data from the infected files.
Now that you have an idea of how to recover files after virus attack, let’s learn about them in detail. We’ll explore methods and steps for restoring files when the system is affected by any type of virus.
Method 1: Isolate and Run Antivirus Scan
Viruses and malware encrypt your files, but fortunately, your data is still retrievable. Running an antivirus or anti-malware scan to remove threats and prevent further damage is the first step before attempting restoration. Let’s see how to run an antivirus scan.
- The first step is to isolate the device, i.e., disconnect your computer from the internet.

- Open your preferred security software and run a full or deep scan. ( If you don’t have any, you can run a Microsoft Defender scan.)
How to run an MS Defender virus scan?
- Open System settings and go to Privacy & Security.

- Click Windows Security.

- Open Virus & Threat Protection.

- Select Scan Options.

- Check the Full Scan and click Scan now.

- Once the scan is complete, Windows will show the scan results and threats if found.
- Open System settings and go to Privacy & Security.
- Once the scan is complete, the antivirus will display a list of threats. Select Delete/Clean the infected items.

Method 2: Unhide the Hidden Files (CMD)
A virus attack does not necessarily mean files are deleted. They often make files invisible, replacing them with shortcuts. The actual data remains on the drive. Files can be unhidden using the “hidden” and “system” attributes by:
- Click Start and type “cmd.” Right-click on Command Prompt and click Run as Administrator.

- Type the drive letter (D:) or use the “cd..” command to navigate to the drive containing hidden files.

- Run the command “attrib -h -r -s /s /d *.*” and press Enter.

attrib: Displays or changes file attributes.
The “+” and “–“ signs indicate whether you want to activate or deactivate the specified attribute.
-h: Clears the Hidden file attribute.
-r: Clears the Read-only file attribute.
-s: Clears the System file attribute.
/s: Processes matching files in the current folder and all subfolders.
/d: Processes folders as well.
*.*: Applies the command to all filenames with any extension.
Method 3: Restore From Backup
Here are the best ways to get your data back from internal storage, starting from easiest to most advanced.
Recovery from File History
If you enable File History in Windows, you can restore files to a state before the virus infection.
- Open the Start menu and search “Restore your files with File History” and press Enter.

- File History in the control panel will open. Click Restore Personal Files from the left side panel.

- Select the file. Browse through the versions using the arrows at the bottom and locate your files.

- Select the files and click the green Restore button at the bottom.

- Replacement of the Skip files confirmation dialog box will open. Click Replace the file in the destination to replace.

File recovery from Windows Backup and Restore
Windows Backup and Restore is a robust built-in feature in Windows 10/11, which you can use if you created a full system backup to an external drive.
- Open the Control Panel and go to System and Security. Click Backup and Restore (Windows 7).

- Click Restore My Files.

- Choose Browse for files or Browse for folders to select the backup to restore.

- Choose the file and click Next.

- Choose a location (new or old) to restore the files and click Restore.

Methods 4: Use Data Recovery Software
When affected by a virus, you think your files are lost forever. Think again! Let’s uncover the truth and bring them back.
- Download and Install Recovery Software: Download the top data recovery software, Notchox, from www.notchox.com. Follow the guided installation steps to complete the installation on your device.

- Select Storage Device/Drive: Choose the storage device or external drive from which you want to recover files after virus attack.

- Scan the Infected Drive: Execute the recovery process to “deep scan.” Find hidden, deleted, or even corrupted files to recover.

- Preview: Check the interim results and verify their integrity. Choose the files to keep.

- Recover: When completed, choose a different storage device(e.g., external hard drive) to prevent overwriting and restore successfully.

Case Study: As per Carsonnow, Nevada completed a 28-day recovery from a statewide cyber incident in August 2025, restoring approximately 90% of the impacted data. The rapid recovery was handled by pre-approved plans and specialised tools to recover data loss.
Method 5: Fix File Extensions
When a virus strikes, it changes your file extensions from, for example, .docx to .locked or .ecc, which makes the files unreadable. So, manually fixing these extensions can get you back your files.
- Open File Explorer.

- Click on the View menu, select Show and checkFile name extensions.

- Select the file, right-click and select Rename icon (or press F2).

- Delete the existing extension and type the original format and press Enter.

Method 6: Scan Drives for Errors
chkdsk can be used to fix file system errors and repair bad sectors. To recover files from a virus-infected USB drive using chkdsk, follow these steps:
- Press Windows + R. Type “cmd” and press Enter to open the command prompt.

- Type “chkdsk <drive letter>: /f” (e.g., chkdsk E: /f, to recover from drive E) and press Enter.

- If prompted to force a dismount or error, type ”Y” and press Enter.
Note: If needed, type “chkdsk E: /f /r /x” to fix any errors, locate bad sectors, or force the drive to dismount.
How to Prevent Losing Files After Virus Attack?

Preventing file loss from a virus attack requires combining proactive security measures with regular backup habits. Here are the best proven techniques to avoid losing files in case of a virus or malware attack.
- Use Antivirus: Install reputable antivirus software and keep it running in real time to delete any virus or malicious threat.
- Regular Offline & Online Backups: Follow the 3-2-1 rule to keep backups. Use cloud storage for online backups in case of any hardware damage.
- Keep Operating Software Updates: Always keep your software and OS updated. Hackers exploit known security loopholes in the outdated software.
- Scan Before Accessing Files: Allow antivirus software to scan before accessing any new file, to detect malware and viruses beforehand.
- Prevent Downloading from Unknown Sources: Only download software and files from official and authorised websites and stores. Avoid downloading cracked software or pirated media.
- User Authentication: Use strong, unique passwords for every account and enable multi-factor authentication to avoid unauthorised access to the file system.
A virus or ransomware attack is one of the most critical threats faced by modern organisations, serving as a wake-up call to weak digital infrastructures. Data recovery after such an event is rarely a simple “restore” process.
To Sum Up
Recovering files after a virus attack is crucial. The primary goal is to stop the spread of the virus and avoid overwriting of the data. Having discussed how to recover files after virus attack and preventive measures for the same, you now have clarity on what to do if your system faces a virus attack. For a direct, easy solution, use data recovery software that guarantees successful data retrieval and offers comprehensive solutions.
Frequently Asked Questions (FAQs)
Q1: How to recover files after a virus attack?
Q2: How to recover files from a virus-infected USB?
Ans: To recover files from a virus-infected USB, open a command prompt. Type chkdsk <drive letter>: /f and press Enter.
Q3: What happens to your files if your computer is infected by ransomware/virus?
Ans: Ransomware deletes or encrypts the files, making them unreadable. But they may be recoverable using data recovery software.
Q4: Are virus-infected files safe to recover?
Ans: Virus-infected files are generally not safe to recover without proper precautions as they can re-infect your system. You must isolate, scan with a reliable antivirus and stop running files to prevent further damage.
Q5: How to recover from a virus asap?
Ans: Immediately stop using the device and disconnect from the internet, then let the antivirus do the scanning, and afterwards you can recover files using version history, CMD, or data recovery software.
Q6: What are the steps to follow to recover after malware incidents take place?
Ans: Steps to follow to recover after a malware attack:
- Isolate and Clean
- Unhide the Hidden Files (CMD)
- Restore From Backup
- Use Data Recovery Software
Q7: What is the first thing you should do after a cyber incident?
Ans: The first thing you should do after a cyber incident is to disconnect the affected device from the network. Isolate and stop using it to prevent spreading and data overwriting.
- Android
- Audio recovery
- Datarecovery
- iPhone
- Linux
- Mac
- Photo & Video Repair
- Photo recovery
- Software Reviews
- Video Recovery


