EC 261/2004 only provides for a refund when the carrier cancels or significantly changes the timing (Section 8 rebooking rights). If you cancel, whether on the advice of the government or not, you are only due whatever your fare rules provide. That will most typically be a credit against a future ticket.
For this reason, you should not cancel until the last minute. That increases the chances that the flight is cancelled, including for reasons having nothing to do with the pandemic, e.g. poor weather.