Use a cloud-based backup service like BackBlaze or CrashPlan that saves old versions of your files. Since these backups are not connected like regular read-write hard drives, there should be no way for the ransomware to encrypt or delete the old versions.