How to reset a Macintosh to factory defaults
If your Macintosh computer needs to be reset to factory defaults due to OS errors, or any other reason, you can use a series of commands to accomplish this.
Local access to a Macintosh computer.
Boot OS with Power button.
cmd & S.
Press enter once get to root prompt.
At the prompt, type:
mount -uw /
shutdown -h now