Undo Factory Reset on oneplus My Kid has been playing with my phone while it was on lock screen, my kid did not have the access code but somehow don't ask my how he somehow managed to factory reset my onePlus 6T.

I googled and found a few commercial programs all promising to solve the issue I tried one gihasoft, but when I try to connect my oneplus to my macbook it fails with "ftp or mtp must be enabled", and I cant find those settings.

Is there anything I can do to restore my device? I'm also quite shocked to learn that it can be factory reset that easy.
Many Android phones can be booted into a recovery mode and factory reset from there. In the case of the 6T you power it off then hold down volume up at the same time as pressing the power button. That boots it into recovery mode, and from there the phone can be reset by selecting the appropriate option. Your child must have managed this without meaning to.

There isn't any way of retrieving the data from the phone. OnePlus or the FBI might be able to do it but there's no way for you or I to do it. However if you go back through the setup and choose the option to restore your data from Google you will get back anything that has been backed up to the cloud.

Reading the data from a factory reset phone would be a serious security flaw. It would mean anyone who stole your phone could reset it to wipe your phone lock then read your data off the phone.