This just hapened to me, and I found out why.
If you (or your pocket) attempt to enter your lockscreen passcode 10 times incorrectly then you are rewarded with a factory reset. What really sucks is that the home button is raised and is easily pressed in pocket. It turns on the lock screen...