It meant crazy before it was used in relation to doors.
Quote:
unhinge (v.)
recorded earlier in the mental sense of "to disorder" the mind, etc. (1612) than in the literal one of "to take (a door, etc.) off its hinges" (1616); from un- (2) "opposite of" + hinge (n.). Hinge as a verb meaning "to attach by a hinge" is recorded only from 1758. Related: Unhinged; unhinging.
Entries related to unhinge
un- (2)
prefix of reversal, deprivation, or removal (as in unhand, undo, unbutton), Old English on-, un-, from Proto-Germanic *andi- (source also of Old Saxon ant-, Old Norse and-, Dutch ont-, Old High German ant-, German ent-, Gothic and- "against"), from PIE *anti "facing opposite, near, in front of, before, against" (from PIE root *ant- "front, forehead," with derivatives meaning "in front of, before").
More or less confused with un- (1) through similarity in the notions of "negation" and "reversal;" an adjective such as unlocked might represent "not locked" (un- (1)) or the past tense of unlock (un- (2)).
hinge (n.)
late 14c., "movable joint of a gate or door," not found in Old English, cognate with Middle Dutch henghe "hook, handle," Middle Low German henge "hinge," from Proto-Germanic *hanhan (transitive), *hangen (intransitive), from PIE *konk- "to hang" (see hang (v.)). The notion is the thing from which a door hangs. Figurative sense of "that on which events, etc., turn" is from c.1600. Stamp-collecting sense is from 1883.
unhinged (adj.)
"thrown into confusion," 1719, past-participle adjective from unhinge.
Hinge comes from the word hang, which you should yourself midxe.