While SG1 attends the extraction ceremony of of the last ga'ul Ba'al, an ominous warning is issued.
Ba'al explains he has a contingency plan in the event something like this ever happened...
(There is a scene in 1939 where Ba'al arrives through the Stargate and takes over a freighter carrying the Stargate, while it is being transported to the Americas by sea)
During the cermony, Teal'c and Vala spontaneously disappear. O'Neil is then killed by Ba'al, and the remaining SG1 team (Carter, Mitchell, & Jackson) frantically dial Earth to escape, while all manner of people and buildings on the Tok'ra world are vanishing one by one.
They go through the gate, only to arrive in the cargo hold of the "Achilles" the ship which was transporting the Stargate to the Americas in 1939, frozen in a block of ice.
Realising they will soon freeze due to exposure, Mitchell uses a block of C4 to blast a way out, but his efforts also dislodge the frozen ship from the ice, and they have to struggle to escape the sinking and buckling ship.
While escaping the ship, Daniel's leg is frozen, and his boot freezes so he can't move. Sam and Mitchell leave him and take off alone across the tundra discussing the paradox they find themselves in. They are picked up by O'Neil, (who in this timeline, is a Special Forces man) and gives them a lift on a submarine that surfaces after he finds them.
They and Daniel Jackson are taken to isolation where they are inteviewed over and over again in a "24"-like montage. They all ask to speak to General Landry as someone who would "understand"...
(Retired) General Landry arrives, and grants them all witness protection, and new lives on the condition that they don't contact each other or take jobs in their various professions. We find out Carter was an astronaught who died in a accident, Mitchell doesn't exist, and Daniel Jackson is a recluse discredited for his insane theories that aliens visited ancient Egypt, and the Pyramids are landing platforms for alien ships.
(After a year passes,) Ba'al arrives with a massive fleet in tow, Taqesh as Queen, and Teal'c as First Prime, he appears to control all the Ga'ould.
Taqesh turns on Ba'al during the invasion and the bombardment of the Earth gate and the ancient weapons platform in Antarctica is ordered. After witnessing the death of Ba'al, Teal'c escapes to a cloaked Al-Kesh through the ring transporter.
Taqesh orders the bombardment of Earth from orbit, and she leaves through hyperspace with the mother-ship. Teal'c is forced to seek the japa-eye on Earth to avenge Ba'al's death at her hands, as it is the only way he can beat her to her destination.
Sam and Mitchell go to Russia, where the second gate is and arrive only shortly before Teal'c does in his Al-kesh. After a short stand-off, they decide to travel together to Ba'al's secret failsafe a Stargate and ring platform, hidden away with a computer to calculate solar flare activity, thus allowing the wormhole to travel back through time by passing though a solar flare.
A firefight ensues as Katesh arrives and sends waves of Jafa through the rings killing Teal'c, Daniel Jackson and Sam Carter in the process, leaving only Mitchell to traverse the Stargate, and attempt to correct the past.
Katesh arrives just before Teal'c succumbs to his injuries saying she will take him as First Prime, to which he answers "I don't think so... I die free" then he drops a grenade to destroy the time-travel device, and all in the area.
Back in 1939, Cam thwarts the attempt to board the "Achilles" by shooting Ba'al and his Jafa as they come through the gate single file.
The scene goes back to the "removal ceremony" on the Tok'ra planet where, this time, all goes as expected, and Vala stays behind to help Ba'al's host cope with the traumatic experience of being removed from his symbiote, while O'Neil as usual, complains about being hungry.
Carter, Jackson and Mitchell discuss what the ominous message from Ba'al was all about, as we see a picture of Mitchell, standing with the Captain of the "Achilles" in 1939 taped to the inside of his locker at the SGC.
SG-1 and Jack O'Neill (Richard Dean Anderson) attend a Tok'ra extraction ceremony for Ba'al (Cliff Simon), the last of the Goa'uld System Lords. He gloats that he is merely the last clone, and that the real Ba'al has a fail-safe plan. The real Ba'al travels back in time to 1939 Earth and massacres the crew of the Achilles, the ship carrying the Stargate to the United States; the captain (Mitchell's grandfather) survives long enough to keep the ship from being destroyed. In the present, people and objects disappear, starting with Vala Mal Doran (Claudia Black) and Teal'c (Christopher Judge). Jack is killed by Ba'al before Samantha Carter (Amanda Tapping), Daniel Jackson (Michael Shanks), and Cameron Mitchell (Ben Browder) manage to reach the Stargate. Carter speculates that traveling through the wormhole shields them from the changing timeline. They emerge inside the derelict Achilles, which has drifted to the Arctic Ba'al's actions have created a timeline in which the Stargate Program never happened. After escaping from the sinking Achilles, they are rescued by a team led by Colonel Jack O'Neill. Although General Hank Landry (Beau Bridges) believes their story, permission is denied to change the timeline. In the alternate timeline Daniel is still trying to convince people about his theories of the pyramids, Carter died in a space shuttle accident and Mitchell does not exist at all because his grandfather died saving the Achilles from Ba'al's bomb. The three are separated and given new lives to lead.
A year passes, and SG-1 is called back into action when Goa'uld scoutships appear. Ba'al has defeated the System Lords and now stands ready to conquer Earth, with Qetesh (still residing in Vala's body) as his Queen and Teal'c as his First Prime. SG-1 is brought to President Henry Hayes (William Devane) and General George Hammond (Don S. Davis), who inform them that, based on SG-1's accounts, they have recovered the Antarctic Stargate and are excavating the Ancient outpost. SG-1 is sent in F-15s to McMurdo to gate to Proclarush Taonas, an Ancient outpost, to retrieve a Zero Point Module (ZPM) to power the Antarctic outpost. Above Earth, Ba'al's armada arrives. To the displeasure of his lieutenants (all former System Lords), Ba'al announces that he will treat the Tau'ri leniently. Suspicious about Ba'al's knowledge of Earth, Qetesh betrays him and forces him to tell her everything. She has her ships destroy McMurdo Station and the Ancient outpost, and she kills Ba'al after Teal'c discovers her treachery. As Teal'c escapes to an Al'kesh, Qetesh orders the fleet to bombard Earth while she goes to secure Ba'al's time machine.
Amidst the massive Goa'uld attack, SG-1 is rerouted to Russia, as the Russians had retrieved the Achilles' Stargate from the ocean floor. En route, they are saved from a flight of death gliders by Russian MiG 29s. Teal'c arrives at the facility as well, seeking to use the Stargate to reach the time machine before Qetesh. The two sides form a truce and arrive together at Ba'al's time machine: a vast underground supercomputer connected to hundreds of satellites that monitor solar flares that could intersect the wormhole formed by the Stargate. SG-1 must wait for the right flare with which to go to the past, but an attack by Qetesh's troops forces them to dial Earth in the year 1929 - ten years before their target date. Sam and Daniel are killed in the firefight, and only Mitchell reaches the Stargate before Teal'c, mortally wounded, destroys the time machine along with himself and Qetesh. After a decade of waiting, an older Mitchell stows away on the Achilles and kills Ba'al and his troops when they come through the Stargate. In the present of the now-restored timeline, SG-1, completely unaware of the previous events, watch the extraction proceed without incident. On Earth, Daniel wonders what Ba'al meant by his fail-safe, but they decide not to dwell on it. The final shot shows a close-up of a picture in Mitchell's locker, in which his older alternate self is shown standing alongside his grandfather.