The best way to keep your data safe from ransomware is to think and act proactively. If you follow the simple steps as stated in the following link, then you have done as much as you can to minimise the chances of a ransomware attack.
However, what do you do if your computer has been infected with ransomware, do you pay up or try to find an alternative solution? No.
The following link takes you to the most up to date list of ransomware decryption tools which should help you to retrieve your data.