We sometimes hear the phrase habeas corpus used in connection with criminal court cases but few people actually know what the words mean. Historically, habeas corpus was a type of writ (court order) which required the bringing of a party or prisoner before the court to provide testimony, evidence, or for some other purpose. The words literally mean “having the body” and a writ of habeas corpus is now understood to mean a command from the court to produce the body of a prisoner or detainee in order to determine whether the person in question is being detained lawfully. Writs of habeas corpus are typically issued in connection with efforts to overturn the unlawful detention of prisoners. The right to habeas corpus is one of the most important protections under our Constitution.
— BBC&B