Reset to factor conditio from CLI ?

I'm not sure I got your question: do you wish to reset to factory to stop the yun from rebooting itself?

The yun reboots because it can't join the wifi you've configured. When it does and it gets back to access point mode, the webpanel will show a textarea with a lot of (cryptic) information you can attach to this forum to get support.

Most of the times the issue is with your home wifi hotspot: that was the main issue we had while developing the yun