When Atlantis first rebelled, he surreptitiously aided the escape of both Ryan Stevenson and Colonel Sheppard from the SGC, though he was later obligated to order an intergalactic expedition to hunt them down and retrieve the renegade flying city. O'Neill did this under protest of the I.O.A.'s decision, but with the knowledge that if he defined the orders broadly enough, his chosen commander, brevet General Carter, could travel to the Pegasus galaxy and then 'fail' without directly contravening orders.
General Carter was of another mind however, and sought to actually capture Atlantis, having being convinced that the possession of the city was in Earth's best interests. When she failed, resulting in the loss of three Daedalus-class battlecruisers and her less than polite exile back to Earth, O'Neill saw that she received no official reprimand, other than the automatic rescinding of her brevet promotion.
An order he couldn't follow...Edit
Later, the conflict with the I.O.A. would escalate to violence when the President of the United States ordered O'Neill to transfer the stargate out of Cheyenne Mountain under a cloak of secrecy into a new I.O.A. run stargate command center in Egypt. Faced with the dilemma of defying a direct Presidential order or betraying his country by participating in the underhanded maneuver, he sought out the advice of the retired General Hammond, who suggested the use of a lockdown tactic that would automatically send out red flags to every governmental agency involved in the stargate program, raising awareness that the President was trying to avoid, particularly that of Congress.
The ploy worked, and Congress immediately leapt into action, but the President dug in his heels and refused to heed their calls to cease the transfer. He sent armed forces to break through security and attack the SGC in order to manually drop the beaming jammers preventing the instantaneous transfer of the stargate. After an initial firefight that resulted in an SGC victory, the President's forces redoubled their efforts and a major confrontation loomed.
The final measure in Congress's power was to vote to remove the President from office...which they informed O'Neill was off the table because it would mean revealing the existence of the stargate program to the public. Without that, they had no way to immediately stop the President, though his political career would be coming to a quick end thereafter. Enraged by the politicians' inaction, O'neill decided to take the decision out of their hands by going public with the information on his own while the President's men were literally cutting their way through the SGC's front door to get at him.
The plan would have forced the politicians to publically deal with the situation, but one of the scientist working on the disclosure project betrayed O'Neill and informed the assaulting forces of his plan. All external communications with the base were immediately cut, ending any hope of informing the public and bringing about a resolution to the situation that would keep the stargate in American possession.
Faced with his loyal subordinates being killed defending the stargate by their fellow soldiers blindly following the President's orders, O'Neill wrote a letter taking full responsibility for disobeying the Presidential order, exonorating those who had followed his orders, then told General Landry to end the lockdown...right after he fled Earth through the stargate rather than face imprisonment.
O'Neill gated to a random planet, where he accidentally found himself in Aschen territory...territory that had been ceased from the Asgard, who were at that time reclaiming the planet. Through his little grey friends Atlantis became aware of the events that transpired on Earth and extended an invitation which Jack took, having nowhere else to go.