The Writ of Habeas Corpus protects prison inmates from false imprisonment to ensure people are not thrown into jail unlawfully. This section constitutes an overview on California habeas corpus practice as it relates to the handling of criminal appeals.The inmate may file a petition for writ of habeas corpus. Habeas corpus refers to the principle of freedom from unlawful detention. A habeas corpus petition is a civil matter that contests a defendant's incarceration or restriction imposed as a sanction in a criminal case. A writ of habeas corpus is a legal order that requires the custodian to bring the detained individual before a court or judge. A Writ of Habeas Corpus is used to appeal a court decision or to challenge conditions of probation or parole. If the court finds that a person was detained illegally, that person must be set free. It's crucial to understand its role in the justice system. United States district court to challenge violations of the Constitution or laws or treaties of the.