Yes, and you should ease into riding again. My neck always gets sore on a road bike if I haven't ridden in awhile. Takes several rides of gradually increasing time/distance to get it back in shape again. I probably wouldn't have tried to go even an hour on a first ride back.

It may take a few days to stop hurting since muscular pain can do that depending on how severe it is.