The story
Etymology from Wiktionary, CC BY-SA 4.0.
Today it means: Said as a retort to someone saying hey (any sense of the interjection), used to indicate that the speaker disapproves of the usage of the word "hey", perhaps due to a dislike of informal speech. Full definition →
Etymology from Wiktionary, CC BY-SA 4.0.