Cyberkracht

Apps and programsOneDrive

Recover your OneDrive files after a ransomware attack

Did ransomware encrypt your OneDrive files? First clean your devices and then safely restore your files.

Beginner · 4 min read

Ransomware is harmful software that encrypts your files and demands a ransom to unlock them again. OneDrive synchronises your files between your device and the cloud. As a result, the encrypted versions can also end up in your online storage and overwrite the healthy versions. In some cases OneDrive can detect such attacks and lets you restore your files to an earlier, healthy state. Whether this is possible in your case depends on your subscription and settings.

Why does the order matter?

If you restore your files while your computer is still infected, the ransomware can encrypt them again straight away. So first clean all devices connected to your OneDrive, such as your computer, laptop, tablet or an old PC. Only then restore the files.

An example: you open an attachment from an unknown email. A little later your photos and documents no longer open and you see a message demanding payment. The files in your OneDrive are unreadable too. Disconnect the computer from the network straight away, have it checked and cleaned, and only then restore your OneDrive. Do not pay the ransom: there is no guarantee of recovery and you fund the perpetrators.

With ransomware

  1. Check which files are affected.
  2. First clean the connected devices.
  3. Then restore OneDrive to a safe state.
  4. Check that files open normally again.

Watch out: Do not restore files on a device that is still infected: they can be encrypted again.

Common mistakes

Avoid this

  • Restoring files on a device that is still infected.
  • Leaving the infected device connected to the internet and OneDrive.
  • Waiting too long, so that older healthy versions disappear.
  • Paying the ransom in the hope of getting your files back.
  • Not changing your passwords after the device was infected.

Tip: OneDrive is not a real backup, because it also synchronises damaged files. So also keep important files on an external drive that you do not leave permanently connected.

What if it goes wrong anyway?

Change your passwords from a safe device, especially those of your Microsoft account and email, and turn on two-step verification. Report it to the police and keep evidence, such as a photo of the ransom message. Read our page My files are being held hostage (ransomware) for the full steps. Did you first click on a suspicious link? Then read I clicked on a phishing link. You can find more help at I am a victim. Also report suspicious messages to Safeonweb.

Frequently asked questions

Can I get all my files back?
That depends on your subscription, your settings and how quickly you react. See Microsoft's explanation via the link at the bottom.

Should I restore first or clean first?
Always clean first. If you restore on an infected device, the files can be encrypted again.

Test your resilienceMicrosoft: detect and recover from ransomware with OneDrive(opens in a new tab)

Log in to save your reading progress.