A writ of habeas corpus is a petition that an individual uses to challenge their conviction or sentence in California. The Writ of Habeas Corpus protects prison inmates from false imprisonment to ensure people are not thrown into jail unlawfully.A habeas corpus petition cannot act as a second direct appeal. A petition for writ of habeas corpus is a legal action that allows individuals to challenge their unlawful imprisonment or restraint. The court explained that a party filing a federal habeas corpus petition must exhaust their state court remedies prior to filing the petition. A writ of habeas corpus is used to bring a prisoner or other detainee (e.g. Yet the Great Writ, like all judicial writs, is a government power. A writ of habeas corpus pursuant to this section is the exclusive procedure for collateral attack on a judgment of death. All civil appeals from a lower court when filed in a higher court. (2) Administrative Review, Superintending Control, Extraordinary Writs.