If you suspect that the problem is with HDD, then take out a linux live cd if you have, and start your Live cd and see if the restart happens again or not. If your pc restarts again, then the problem should be with something other than HDD.