Remedies. While a petition is pending, a federal district or appellate court may stay any state court proceeding against the petitioner. When an indigent death row petitioner files for appointment of counsel before filing a legally sufficient petition for habeas relief, the habeas proceeding has commenced for purposes of § 2251, and the federal court is consequently authorized to stay the execution. A federal court granting habeas relief has wide discretion in choosing the appropriate remedy. Courts have ordered the state to resentence a petitioner, reclassify a petitioner's conviction, or grant the petitioner a retrial on specific issues. Unconditional release of the petitioner is a remedy of last resort, generally granted only when a state has failed to comply with federal court orders specifying other forms of relief.