Restoring data can restore malware too

If the backup was taken after the attacker got in, restoring it restores them.

Ransomware crews are frequently present for weeks before anything encrypts, so recent backups may contain their access as faithfully as they contain your data. Recovery therefore needs a view on when the compromise began, and backups old enough to predate it, which is a different question from whether backups exist.

More on Backups and recovery