Welcome to the forums.
That is what we know in the Mac world as a Kernel Panic.
It can be caused by a multitude of things. ie: 3rd Party Apps or a usb peripheral
Best bet is too Repair Permissions via Disk Utility in Applications>Utilities
Open DU click on the HD in the left column. Make sure First Aid is clicked then down the bottom Repair Permissions.
Once its finished (this could take a while and take no notice of the logs) reboot the Mac. Hope that does it, but if not fault find by disconnecting your USB peripherals 1 by one until it doesn't happen. OR look for and Apps you recently installed or Extensions.
That's what's known as a "kernel panic". It may have occurred because of a hardware problem or software. If it only happened one time and does not occur again, I wouldn't worry over it.
What makes you think you lost your entire hard drive? Do you still have access to the machine? Can you log on?
I did all that. No help. After some research it appears that this is a known issue with the iMacs. I will try again in a couple of months after Apple releases a few updates.
Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.