The Writ of Habeas Corpus is a legal defense against unlawful incarceration. The Writ of Habeas Corpus protects prison inmates from false imprisonment to ensure people are not thrown into jail unlawfully.A Writ of Habeas Corpus is a formal legal document which orders a detained person to be brought before the court to decide the legality of their incarceration. If you are filing this petition in the superior court, you only need to file the original unless local rules require additional copies. Habeas Corpus, in the Federal Court, is a petition that claims that you are being detained against your US constitutional rights. A writ of habeas corpus is designed to be an effort of last resort to overturn a wrongful conviction. To get a writ of habeas corpus, you must file a petition for a civil (not criminal) proceeding in either state or federal court. Understand the key differences between an appeal and a writ of habeas corpus, including their purposes, processes, and when to use each in legal cases. A habeas corpus petition in California allows you to challenge your conviction or sentencing. You can file it only after exhausting all criminal appeals.