Welcome to Health Care Magic.
Based on the symptoms you mentioned, you might well have injured your neck ( possible whip lash injury
) or could just be a muscle spasm. But as far as my guess you might have injured your neck.
Do not worry. The injury may not be severe. It should be a small injury , can be treated with pain killers and some rest . Muscle relaxants and vitamin B12
containing preparations might help you.
Ice pack or Hot fomentation on neck and the effected are will give you symptomatic relief.
Please get an X ray
of your neck to rule the possibility of a bony injury and the extent of damage.
Meanwhile avoid using pillow under your head and avoid excessive movements of our head( which might aggravate the injury).Do not massage
your head or neck.
Hope your neck injury
is not serious.
Wish you a speedy recovery.