My understanding is that wearing hats of various kinds was much more widespread historically (e.g. in the late 1800's and early 1900's) than it is today, with sometimes complicated etiquette with regard to when the hats should be removed. When I wear a hat for a long period, I get "hat hair" and I am loathe to remove the hat at all until I arrive back home and can fix it. Historically, did people have hat hair more or less all the time? Were hats designed to mitigate hat hair? Am I just wearing them wrong?
"Hat hair" was a universal affliction when all men wore hats. Sometimes they don't bother to fix it up after taking off the hat, even when taking a photograph, and so you end up with photos like this:
If you look through lots of photos from that period, you can find plenty of examples of hair with the characteristic hat crease.
Given that the pocket comb was once commonly carried by men and women, I imagine that's how most people dealt with hat hair - or not at all, as in the case of the famous hat-wearer, Abraham Lincoln, who had a reputation for very messy hair.