Etymology of "unhinged"
Going by the OED, the modern use of unhinged to mean “psychologically disturbed” is a specialisation of a more general and slightly earlier use meaning (in the OED’s words) thrown into confusion; unsettled, disordered:
I might by my loose and unhing’d Circumstances be the fitter to embrace a Proposal for Trade.
— 1719, Farther Adventures of Robinson Crusoe, Daniel Defoe.
(Of course, this more general sense is still sometimes used, although the mental sense is certainly now dominant.)
This in turn comes from the fairly transparent metaphor of a door that has slipped its hinges, which appears rather earlier:
The wisest and best Poets doe loue sometimes to play the foole, and to leape out of the hindges.
— ?1608, Of Wisdome i. xiv. 62, S. Lennard, trans. P. Charron
A person in a normal state would be "hinged," or "put together."
So "unhinged" would imply the opposite, of being "undone."