In the Warring States Period, Lin Xiangru, chief minister of the State of Zhao, was sent as an envoy to the State of Qin. His mission was to request the return of a precious piece of jade to Zhao. However, the ruler of Qin proved to be rude and unreasonable. Lin was so enraged that his hair stood up stiffly, lifting his hat right off his head.
This idiom is used to describe a state of extreme anger.