We'll discuss soft/hard reset methods for restoring the UniFi Security Gateway (USG) to its factory default settings.
Hard Reset Button
Press and hold the reset button until the Orange LED above the VoIP port begins to flash quickly. After the LED begins to glow solidly, you can release the reset button. Wait 60+ seconds for the default configuration to be restored.
Reset via Software
While logged in to the UniFi Controller, click Devices, then select the USG to be reset. Under Configuration, Forget this USG, click FORGET.