I suppose there was no brief period of unconsciousness
in your case.
Are you having nausea , visual disturbance or severe headache?
As you hit your friend's head and both of are otherwise fine so I do not think the impact was so severe to cause head injury
. What is more probable is that it might be a vestibular sensation something like a vertigo because of the impact.
What I suggest is try to sleep for a couple of hours and see if that helps.
If the symptoms are persistent or you have vomiting
or severe headache then I suppose you might have to get a MRI Brain ( plain ) done.
Advice: Be slow in your movements of change of position.
Apply ice packs locally at the point of impact to reduce soft tissue
In case the spinning sensation is the only symptom that you face and it is persistent then see an ENT specialist
to get a thorough examination of ear and vestibular apparatus.