The writ of habeas corpus is the remedy to be used when any person is restrained in his liberty. In Texas, the state writ of habeas corpus is a legal mechanism that allows individuals to challenge their detention or imprisonment.A writ of habeas corpus is a legal tool that a person can use to enforce a superior right of possession to a child. A Writ of Habeas Corpus (Latin for "that you have the body") may be filed on behalf of a person who is unlawfully imprisoned. A writ of habeas corpus is a court order issued either to an agency or a person who is holding someone in custody. An application for a writ of habeas corpus asks a court to overturn your conviction because of a state or federal constitutional violation. Habeas corpus literally means "produce the body. An application for a writ of habeas corpus asks a court to overturn your conviction because of a state or federal constitutional violation. If the defense was not aware of this evidence before trial, a writ of habeas corpus would be the proper legal means to present it to the court. It gives judges the power to require law enforcement to justify an arrest.