Sharp Pain in your head can be caused by several things but what I believe you may be experiencing is Occipital neuralgia.
Occipital neuralgia is a condition that causes a sharp pain in the back of the head and neck and the sharp pain can feel like electric shocks, jabbing or other sharp pain that is intense.
If it's caused by the above you may also experience Aching, burning, and throbbing pain that begins at the base of your head and goes to your scalp.
It could also just be a bad headache or maybe you have something serious going on that needs checked out.
If the pain continues or gets worse then seeing a doctor about it is best just to be sure nothing serious is going on and if something is going on that is serious then it can usually be corrected and stopped before it gets too bad.