A (writ of) mandamus is an order from a court to an inferior government official ordering the government official to properly fulfill their official duties or correct an abuse of discretion. (See, e.g. Cheney v. United States Dist. Court For D.C. (03-475) 542 U.S. 367 (2004) 334 F.3d 1096.)
Rules on mandamus and similar orders vary by jurisdiction. In the federal courts, these orders most frequently appear when a party to a suit wants to appeal a judge's decision but is blocked by rules against interlocutory appeals. Instead of appealing directly, the party simply sues the judge, seeking a mandamus compelling the judge to correct his earlier mistake. Generally, this type of indirect appeal is only available if the party has no alternative means of seeking review.
See Civil Procedure