The writ of habeas corpus is the remedy to be used when any person is restrained in his liberty. Habeas corpus refers to "a writ employed to bring a person before a court, most frequently to ensure that the person's imprisonment or detention is not illegal.This Chapter explains an important right—the writ of habeas corpus. 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 requires that a person who is in custody be brought before a judge or court and that they be able to challenge that custody. When a Writ of Habeas Corpus is filed, you are asking the court to order the government agency to appear and bring you before the court. A writ of habeas corpus is a legal tool that a person can use to enforce a superior right of possession to a child. § 2255 (2012) is not a petition for a writ of habeas corpus, but it has the same effect. Therefore, it is still referred to as a habeas petition. 6. A writ of habeas corpus is typically the vehicle to litigate newly discovered evidence as well.