iPhone got erased/reset automatically
I am using iPhoneX, with iOS 11.4. My phone got reset suddenly without touching and login remotely on any other device using my apple ID. It was in my pocket only and without my knowledge and confirmation everything got erased. I lost my one month data. Would like to understand how it has happened and how do I make sure that it want happen in future?
iPhone X, iOS 11.4