The writ of habeas corpus is the remedy to be used when any person is restrained in his liberty. Essentially, a writ of habeas corpus is a legal means for any person who is restrained in his liberty to challenge an unlawful restraint.An application for a writ of habeas corpus asks a court to overturn your conviction because of a state or federal constitutional violation. A writ of habeas corpus is a legal tool that a person can use to enforce a superior right of possession to a child. Habeas corpus is what's called an extraordinary remedy and used to challenge the lawfulness of a person's confinement or their restraint. In Texas, a writ of habeas corpus is a court order in which the judge demands a law enforcement agency to produce a detainee for a court hearing. What is a Writ of Habeas Corpus? This video explains habeas corpus and provides examples of pre-trial and post-conviction writs. Habeas Corpus is a legal action through which a person can seek relief from unlawful detention. In custody disputes, a parent may file a writ of Habeas Corpus.