Sounds as though it was just a brown out that triggered a restart. Glad it's still ok though. If it starts becoming a common occurance though, why not invest in a small UPS? Brownouts wouldn't have any affect on it, and should you have a blackout, you'll have time to save your work and shutdown your system.
I'll have a look for a few for you, if your interested. You wouldn't need a huge expensive one, just with enough omph to suffer brownouts and a few mins to shut down in blackouts.
Here one, but 400VA at a max output of 230Watts. Should do most light, non-soupped up systems. £31.75inc Vat.
http://www.ebuyer.com/UK/product/126404
Here's a better suited one I guess, supporting 600VA at 360Watts max output. gives you roughly (quoted from the Discription) 20mins uptime. £36.99inc Vat.
http://www.ebuyer.com/UK/product/126405
Or a heavier one, 800VA at 480Watts max output. £45inc Vat
http://www.ebuyer.com/UK/product/126406
If at all your interested, I'd go for the middle one usless you've got a heafty PC to power. It's only about £5 more than the cheapest one but disproportionately better.