Factory reset will not restore the root partition i.e. files that you added or removed, so be very careful. It also will reset the SSH password, so if you have custom software installed, it could break UI of the device after a factory reset. Always revert your systemd services to make sure that third party launchers etc are disabled and xochtil is enabled before performing a factory reset through the UI.
It's only use is to remove the config and all the documents from the device if you want to give it to someone else.
TODO (link to a repo with the scripts):
If you still have access to the device over ssh.
Note: Never perform a factory reset with xochitl disabled. This factory reset will create a new ssh password once xochitl is started again, which you can't see, so you'll lose access to your device.
If anything went wrong, you can try to recover your device.