An offline backup is the best option for recovering data after a ransomware attack. It is stored in a manner that is not accessible from the network, making it less vulnerable to encryption or deletion by ransomware. Since offline backups are not directly connected to the systems, they provide a secure recovery option without the risk of the ransomware affecting the backup data.