What is the origin of idiom "Keep your hair on"?
Keep one's hair on indeed means
To stay calm or, to be patient.
History
As far as I know, it's a colloquial British English idiomatic expression, urging the other party not to lose their cool. However, it seems to have spread across the globe and is widely used across the US, Australia and other English speaking countries.
Acc. to Google Ngrams, the phrase first appears in 1868-69. To keep your shirt on has the same meaning and tone but doesn't seem to appear before 1870-71, according to Google Ngrams and in 1904 according to Etymonline.
NOTE: The expression "keep your hat on" predates them both to the year 1804.
Extended Explanation (Disclaimer: This is some sheer guesswork, putting two and two together.)
The idiom seems to be constructed from that fact that one might lose their hair due to stress (check this), or even might pull it out in exasperation, anger or frustration.
The Ngram results definitely indicate that keep your hair on is currently more popular than keep your shirt on". And for what its worth, these expressions have nothing to do with to let your hair down.
Summary
The phrase suggests the subject is getting so angry they're about to pull their hair out in exasperation, and should calm down instead. I found in print as early as 1879 and in an 1889 dictionary. Correspondence in the 1902 Victorian version of Stack Exchange says it was heard as early as 1853 and gives some possible etymologies.
Modern dictionary
The Concise New Partridge Dictionary of Slang and Unconventional English (2008) by Eric Partridge, Tom Dalzell and Terry Victor says:
keep your hair on! don't get upset! NEW ZEALAND, 1984
keep your shirt on! calm down!, relax!, compose yourself! UK, 1854
Early dictionaries
Passing English of the Victorian Era (1909) by J. Redding Ware:
Slang and Its Analogues Past and Present (1890) by John S. Farmer and W.E. Henley gives some variants:
On the same page they give to raise (or lift) hair, an American phrase meaning to scalp, and figuratively to defeat; and to keep one's hair is to escape danger. This may or may not be related.
A Dictionary of Slang, Jargon & Cant (1889) by Albert Barrère and Charles G. Leland is briefer:
Early citations
However, it can be found much earlier in New Zealand's Observer newspaper (Volume 5, Issue 114, 18 November 1882, Page 153):
And slightly earlier in the South Australian Register (Adelaide, SA, Saturday 18 October 1879, p6), itself quoting The Glasgow Weekly Mail of August 18:
An hour's sail in a crowded tugboat lands the passengers at Port Adelaide where there ensues a wild scramble for luggage, some of it having to be fished out of the water, and a wordy combat with porters and railway servants, who, should you get excited, coolly tell you to 'Keep your hair on.'
Notes & Queries
Finally, the phrase is discussed at length in several 1902 editions of Notes and Queries (aka the Victorian Stack Exchange).
Notes and Queries (Page 335, 1902)
"Keep your hair on" (9th S. ix. 184).— My earliest recollection of this saying traces it no further back than the fall of 1871. At the Lord Mayor's Show in 1869 it was not heard in the streets. On Thanksgiving Day, February, 1872, it became a ...
... and the even worse crush at the illuminations, people were sometimes hard put to it to "keep in their rag." But then, as since, the customary reply from the good-tempered sort (of whom there are numbers in the world), when told to "keep their hair on," was "Haven't lost it yet." Some few years ago Lord Goschen said, in one of his public speeches that many of the slang or "cant" words in popular use originated in the schools and colleges of this country. He instanced "bloke" and "mug" ("mugster"). To show that "keep your hair on" had probably a likewise collegiate (or academic) origin, I should like to quote a few lines from Barrère's 'Argot and Slang: a New French and English Dictionary Words,' 1887 :—
"The English public schools, but especially the military establishments, seem to be not unimportant manufacturing centres for slang. Only a small proportion, however, of the expressions coined there appear to have been adopted by the general slang-talking public, as most are local terms, and can only be used at their own birthplace.....At Harrow.....a man who is vexed or angry 'loses his shirt' or his 'hair'; at Shrewsbury he is 'in a swot'; and at Winchester 'front.'” HERBERT B. CLAYTON.
39, Renfrew Road, Lower Kennington Lane.More than twenty years ago I was coming down one of the poorer streets of Hull and met a boy going to school smoking. I vainly tried to snatch the pipe out of his mouth. When the lad had got a safe distance from me he lifted his right hand to his nose, extended his fingers fan-like, and called out to me, "Keep your 'air on." I am able to fix the period in my mind, as I well remember the house in which I then lived.
William Andrews.
Royal Institution, Hull.I certainly recollect hearing this phrase used in the sense of "Don't be too excited" as far back as 1853, and have no doubt it was then well established.
E. F. D. C.No doubt the slang sense illustrated in 'N.E.D.' is distinct from the literal meaning in Holcroft. But the underlying thought which gave rise to the expression in 1799 must surely have led directly to the slang sense long before 1883. A man is bidden to "keep his hair on "—i.e., not to allow himself to be ruffled by the storm of a sudden passion. The thought, which is exaggeration of fact in the one case, becomes metaphorical in the other, but the thought is the same.
W. C. B.
Another Notes and Queries (9th S. X. July 12, 1902, page 33):
"KEEP YOUR HAIR ON " (9 th S. ix. 184, 335). Referring to the quotation from Barrère by MR. CLAYTON, I heard a janitor of a gymnasium complain of unsuccessful remon- strance with intruders in these terms : "I spoke to them about it, but they began to get a bit shirty, so I had to fetch Mr. ------ [his superior officer] to talk to them." A schoolfellow said once to me : "You are swotting for top place" : an equivalent for sweat or grind, no doubt.
FRANCIS P. MARCHANT.
Brixton Hill.This expression is common or is frequently heard in Gloucestershire. Its origin is supposed to be coeval with wigs or the wig period. Irascible and aged gentlemen, "when mad with passion," have been known not only to curse and swear, but to tear their wigs from their heads, and to trample them under their feet, or to throw them into the fire. Very often when I have manifested symptoms of anger I have been admonished by country fellows, "Kip thee yar on, maystur !" This expression is synonymous with keep your temper, or don't get into a rage. Whenever I have heard the expression, I have invariably associated it with the old country squire who got into a thundering rage and threw his wig off his bald head and trampled it under his feet. Some- times a similar expression or mandate is used, "Kip the wig on, ould mon." I have frequently heard old country farmers and farm labourers say, "Daz my wig!" or "Dash my wig if I wool," or "I dooes." In the old days, if a man wished in his passion to be emphatic, he threw off his wig.
H. Y. J. TAYLOR.
Gloucester.It is surprising to hear that this catch- phrase was in use so early as 1853. Since this is the case, is it not probable that it existed even much earlier, that it may indeed be traced to the latter half of the eighteenth century, which saw a serious change of fashion in the disuse of the peruke and the return to the custom of wearing one's natural hair? 'I strongly suspect that the phrase has some relation in its origin to that of "Wigs on the green," for there must be an unusual difficulty, where there are "Wigs on the green," (see 9th S. iii. 492), in "keeping one's hair on."
J. HOLDEN MACMICHAEL.I remember in 1885, when I was an articled clerk in Derbyshire, hearing a discussion between a solicitor and a farmer in a room of the comfortable old hostelry which forms part of the Derby Law Courts. The farmer was endeavouring to end a misunderstanding which had arisen by saying, in reference to some prior dispute between them, "That was where you got your hair off," a phrase he repeated several times, to the great annoyance of the solicitor, who happened at the same time to be rather young, very bald, and extremely irascible.
JOHN HOBSON MATTHEWS.
Town Hall, Cardiff.At the latter reference a passage is quoted from Barrère's 'Argot and Slang.' The last word of this quotation ought, I suspect, to have been frout, and not "front." H. C.
A later N&Q (9th S. X. Aug. 23, 1902):
"KEEP YOUR HAIR ON" (9 th S. ix. 184, 335; x. 33). A propos of MR. MARCHANT'S allusion to the word "shirty" 'as a slang expression for loss of temper, I overheard in the streets, on the very day of your last issue, a similar slang word. Two "vulgar boys," but by no means "little vulgar boys," were talking, and one of them said, "He fairly got my rag out," his rag being presumably his shirt. Probably the expression "to have (or get) one's shirt out " has arisen, says Dr. Lentz- ner in his 'Dict. of Australian Slang,' from the shirt working out between the breeches and waistcoat during a struggle. In Surrey "shirty" means short-tempered, irritable. As regards "rag" meaning " shirt," a soldier's slang for the monthly inspection of kit--when all the necessaries, shirts, socks, and under- clothing, are displayed--is "rag-fair." With regard to "swot" in the sense in which it is used among students, the word is a very ancient form of "sweat," and is employed as an army term for mathematics, probably in allusion to the hard work of an examination. It is said to have originated in the broad Scotch pronunciation by Dr. Wallace, one of the professors at the Royal Military Col- lege, Sandhurst, and to have afterwards been fashionable at the universities. It is not necessary, however, to go to Scotland for this pronunciation of the word, for "swat" is still in use in Staffordshire, and in C. H. Poole's 'Staffordshire Glossary' Chaucer's 'Rime of Sir Thopas' is quoted:-
His fair stede in his pricking
So swatte.Again, in Percy's 'Reliques,' i. 25:-
They swopede together whille
that they swotte.The sweating sickness was called the "swatt" (see Archcoeologia, xxxviii. 107).
J. HOLDEN MACMICHAEL.In 'Epistolae Ho-Elianae' (eleventh edition, p. 476) it is stated that, aforetime in France, "Il a perdu ses cheveux" meant "he has lost his honour."
"For in the first Race of Kings there was a Law called La loy de la Cheveleure, whereby it was lawful for the Nobless only to wear long Hair, and if any of them had committed some foul and ignoble Act, they used to be condemned to have their long Hair to be cut off as a Mark of Ignominy."
The modern meaning of the phrase "keep your hair on" is, however, probably that attached to it by your correspondents.
ST. SWITHIN.This expression has been common in Shrop- shire for at least twenty-five years, and probably much longer. "Don't get your shirt out" was a frequent injunction when I was at school. Like MR. MARCHANT'S friend, we employed the verb to swot. Boys who worked hard for examinations were dubbed "swots," a term of contemptuous reproach.
CHARLES HIATT.[We supposed "getting the shirt out" meant taking off the coat for the purpose of fighting and so displaying the shirt.]
‘Chambers Slang Dictionary’ suggests that it perhaps describes ‘the image of tearing one’s hair out when in a rage’. Alternatively, ‘though probably a folk etymology at best, it arose from the need for members of US pioneering wagon trains to keep calm in the face of an Indian attack (were they to panic, they might well be scalped, thus losing their hair’. The dating is 'late 19C+'.
The opposite, get one’s hair off, meaning ‘to become angry’, originated in Australia in the 1930s.