habeas corpus - 1465, from

habeas corpus - 1465, from L., lit. “(you should) have the person,” in phrase habeas corpus ad subjiciendum “produce or have the person to be subjected to (examination),” opening words of writs in 14c. Anglo-Fr. documents to require a person to be brought before a court or judge, especially to determine if that person is being legally detained. From habeas, second pers. sing. pres. subjunctive of habere “to have, to hold” + corpus “person,” lit. “body.”

More generally, habeas refers to appealing to a higher power when an injustice has been done.