In some cases, you can recover or restore previous versions of your files. However, the following conditions must be in place:
System Restore Point must have been turned on before you were infected with the malware.
You must already have detected and removed the malware, and there can be no traces of it on your PC. You can use Windows Defender Offline, as describe in the question below "How do I remove a ransomware infection from my PC?", to fully clean your PC.
Your files must be on the same PC you're using to recover them (that is, the files aren't on a network or removable drive).
OneDrive for Windows 8.1 also has a means of restoring previous versions of Microsoft documents. Similar to System Restore Point, you can look at the version history and recover files from a previous state:
Right-click on a document and click Version history.
You can then look at previous versions of the document, so you can go back to a version that hasn't been encrypted or changed by malware.