You can also perform a hardware reset by cycling power while holding the MRES button (or using the mode switch) until the STOP LED blinks rapidly, then releasing and pressing again.
Siemens S7-300 CPUs store user program and password on the MMC card. Legitimate recovery options: simatic s7 200 s7 300 mmc password unlock 2006 09 11