The headache is from low glucose and encephelitic inflammation combined with dehydration. The antidote to hangovers is to avoid seedoils while you're drinking (like peanuts and fried food) and to drink at least two glasses of water before you go to sleep.