On Monday (Jan. 30), Sally Yates was fired from her position as acting US attorney general almost immediately after instructing the justice department not to defend president Donald Trump’s new immigration policies in court. Yates said she was not convinced that defending the executive order that establishes those policies was consistent with her responsibility to stand for what is right, nor was she was she convinced that the order was lawful.

Yates is not alone in challenging Trump’s immigration order, which indefinitely blocks Syrian refugees from entering the US, blocks refugees from all other nations for four months, and places a 90-day ban on entry to the country from seven Muslim-majority nations (read the full text here). After Trump signed the order on Jan. 27, protests erupted at major US airports, business executives condemned the order, and the American Civil Liberties Union challenged it with a lawsuit.

Can an executive order be revoked? There are three ways—but none of them commonly occur, at least not while the president who issues the orders is still in office.

The president can revoke, modify, or supersede any executive order: Presidents often undo the executive orders of their predecessors, but they have rarely retracted or overridden their own executive orders. “This early on, to admit that you’ve made such a huge mistake would be very politically damaging,” says Alvin Tillery, an associate professor of political science at Northwestern University. “And I think that the response with protests and so on, it would just give further fodder to people who want to challenge [Trump’s] policy positions.” Congress can revoke, modify, or supersede an executive order if the president was acting under authority granted by Congress: But if Congress makes changes that the president disagrees with, it can expect to face a presidential veto, which it could only override with a two-thirds vote in both the House and the Senate. One 2006 study (pdf) cited by the Congressional Research Service found that only about 4% of executive orders have been modified by Congress. “Usually when they do act, it’s to provide funding to an executive order, or to build an executive order into a statutory framework,” says William Howell, a professor of American politics at the University of Chicago, who has written extensively about executive power. “They fortify an executive order.” Courts can declare an executive order illegal or unconstitutional. Barring several notable exceptions however, the courts do not regularly overturn presidential actions. In Howell’s book Power without Persuasion: The Politics of Direct Presidential Action, he attempted to identify every court case that has challenged an executive order between 1945 and 1998. In 83% of them, the courts ruled in favor of the president.

Despite the historical infrequency of executive orders being revoked within the same presidential term as they are issued, Trump’s immigration order has already changed. The US Department of Homeland Security issued an order on January 29 essentially exempting legal permanent US residents from the ban. Though agencies sometimes clarify their interpretation of an executive order, Howell says the DHS action was fairly unusual. “In the aftermath of most executive orders, if not silence, there is at least broad acquiesensce,” he says “Presidents usually vet them, they talk to key political actors, get their input … The subjects that would require clarification, whoever writes the order is usually aware of them and provides clarity in order.”

On January 28, a federal judge also issued an emergency stay against the executive order in response to the ACLU lawsuit, which was brought on behalf of two Iraqi men detained at JFK International Airport in New York. The ruling temporarily prevented the government from deporting some people who had already arrived at airports in the US.

While checks on executive orders may not be used frequently, they do place limits on presidential power, Howell says. “A president, in principle, could write whatever they want in an executive order, but it would be wrong to conclude that president can remake the political universe in his image,” he asserts. “There are meaningful institutional checks that apply.”