My Oneplus One just performed a random factory reset

So my OPO had some problems with random reboots, but now everything went to shit. I thought it was going to be just another restart, but when the phone finally resumed, I was greeted by a fresh CM11 screen.

This is absolutely infuriating, and the amount of reconfiguration I'll have to do makes me want to scream. On top of that, it looks like Google no longer offers the mass app restoration. GG

So was it a hardware or software fault? How can I prevent this in the future? Why did it even happen?

Shall I start looking for a new phone?

probably should just ship it to my door :)

Need more info, can't decide anything from that.

Well, it stopped happening already after the second factory reset.