What does Hair of the Dog Mean?

When a person drinks a bit too much and wakes up the next morning feeling really bad, some people say that having another drink will actually make you feel better. They say to have a little of the hair of the dog that bit you.