Factory reset will not restore the root partition i.e. files that you added or removed, so be very carefull
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.