To reset a FortiGate back to it’s factory default settings, under the Dashboard on the WI use the CLI Console (or connect to the FortiGate directly to the console) and run the following command:
You will then be prompted with the following message:
This operation will reset the system to factory default! Do you want to continue? (y/n)
If you are connecting via the web interface, it’s a good idea to have a ping going to see when the factory reset is complete because the IP address will change and you won’t be able to see when the reset is complete.