I agree with the other comments here that in the future, to implement a backup strategy for your most important files.
Another thing to consider would be to install security software (disclaimer: at Avast we provide
antivirus software). One thing to remember is that modern antivirus is that it can be a lot more than just "old-school AV." Avast, for example, can protect you against malware, ransomware, as well as traditional viruses and even unknown or never-before-seen threats (zero-days.) Internet Security even has an option to further lock down your files in the event of a ransomware attack, for extra peace of mind.
Ultimately it's up to you what to use -- but we recommend that you keep your PC safe, in any case!
One last thing -- occasionally, depending on the strain of ransomware, you may be able to decrypt your files. You can check out nomoreransom.org, or our
own list of ransomware decryptors, to see if there is something there that may help restore your files.