I highly doubt that your phone would hard reset itself. Although it is possible to reset remotely if you triggered it from your Microsoft account. For windows phones the procedure for update and hard reset is same, spinning gears. It is also possible that the OS is applying some update.
But unfortunately, if it's indeed a hard reset operation, it can not be stopped once started. Unless you have any backups of the device, you wont be able to recover any data from the phone itself, but the memory card may have its data intact.