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)).
Old English gyrdan "put a belt or girdle around; encircle; bind with flexible material; invest with attributes," from Proto-Germanic *gurdjan (source also of Old Norse gyrða, Old Saxon gurdian, Old Frisian gerda, Dutch gorden, Old High German gurtan, German gürten), from PIE *ghr-dh-, suffixed form of root *gher- (1) "to grasp, enclose." Related: Girded; girding.
Throughout its whole history the English word is chiefly employed in rhetorical language, in many instances with more or less direct allusion to biblical passages. [OED]
As in to gird oneself "tighten the belt and tuck up loose garments to free the body in preparation for a task or journey."
<a href="https://www.etymonline.com/word/ungird">Etymology of ungird by etymonline</a>
Harper, D. (n.d.). Etymology of ungird. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/ungird