Fixing your settings
Once failsafe mode is triggered, the router will boot with a network address of 192.168.1.1/24, usually on the eth0 network interface, with only essential services running. Using SSH or a serial connection, you can then mount the JFFS2 partition with the following command:
mount_root
After that, you can start looking around and fix what’s broken. The JFFS2 partition will be mounted to /overlay, as under normal operation.
Soft Factory Reset
If you want a clean slate, there’s no need to flash again; just enter the following command and your device's settings will be reset to defaults like when LEDE/Openwrt was first installed.
umount /overlay && firstboot && reboot
Note: for most routers, “firstboot” actually just issues a “jffs2reset” command, so there is no difference compared to the “hard reset” advice below.
Hard Factory Reset
This command will erase and reformat the whole jffs2 partition and create it again:
umount /overlay && jffs2reset && reboot
While essentially doing the same thing as firstboot, this actually rewrites the whole flash area of the JFFS2 (read-write) partition instead of just re-formatting it.
Source: https://lede-project.org/docs/user-guide/failsafe_and_factory_reset