As a warning when you choose to reset the device please keep the device powered on and do not connect while the reset it taking place. The reset should only take a couple of minutes to complete.
Physical Factory Reset
Finds a suitable thin object (Paperclip or similar)
Locate the reset button on the bottom of the device near the network port labelled as “reset”
Push the end of the paperclip into the reset hole untill you feel pressure and a slight click. Hold the reset button down for 10 seconds.
If the reset button has worked you will see the lights on the AP begin flashing as it resets.
Managed by Controller
If the access point is managed by a controller. Login to the controller and navigate to the devices tab and click on the unifi device that you would like to reset. Once in the properties panel select the configuration tab and click on manage device to expand. Click the Forget button and this will reset the ap.
SSH
Connect to AP via SSH and issue the command:
syswrapper.sh restore-default and hit enter
The unifi device should quickly reboot with factory settings.