stm32f051 Overwritten reserved
You can reset the option bytes of a STM32 device to their factory settings with SEGGER's J-Link Unlock STM32 tool. It is included in some SDKs but you can download it here : 

https://www.segger.com/downloads/jlink

You can also use J-Flash that is also included in J-Link to do a full erase.
Check this link too, it might help.