Hair of the dog
The full phrase is "hair of the dog that bit you," and it refers to an old folk remedy for rabies: placing hair from the offending dog on the wound. By the 16th century, the phrase was applied to drinking more alcohol as a cure for a hangover — the logic being that the cause of the ailment could also be its remedy.