You can't, and even if you could, that wouldn't protect you. If you could, and it did, then Ransomware wouldn't be a problem to anyone, would it? But what if the disk is formatted, repartitioned, or just fails? Nothing would save your file then...
Instead of trying to protect a single copy of a file, instigate a good, solid backup system to ensure that if anything does happen to the file - or any other part of your computer - you can fix it quickly, easily, and with minimal data loss.
I use
AOMEI Backupper: Data Backup and Restore Software for PC, Laptop and Server[
^] which has a full-featured free version and can save your entire week.