Hair of the Dog
Meaning
Using something from A as an antidote to solve B’s problems caused by A.
Origin
Hair of the dog is part of a longer expression the hair of the dog that bit you. This goes back to the old belief that the hair of a dog that bites someone could be used as an antidote against the bad effects of the bite. By extension, another drink or two after a drinking binge would be the cure for a hangover.