From http://en.wikipedia.org/wiki/Hair_of_the_dog
‘Hair of the dog’ is a colloquial English expression predominantly used to refer to ingestion of alcohol as treatment for a hangover. It is occasionally used with respect to dealing with the aftereffects of use of other recreational drugs. It is a shortened form of the expression “the hair of the dog that bit you.”