Before I Sleep

"Before I Sleep" is the fifteenth episode of the first season of Stargate Atlantis.

Plot
The episode starts off with Major Sheppard congratulating Dr. Weir to her birthday and giving her an earthenware pot which the Athosians made. Afterwards he, Lt. Ford and Teyla explore Atlantis while Dr. McKay watches from the control room and hopes to find bigger quarters. In a laboratory a cryogenic-like chamber is found, with what appears to be an Ancient woman inside, one who did not evacuate the city with the others.

McKay believes that the Ancient is in some sort of stasis, slowly aging but she will eventually die since she is already very old. Despite Dr. Beckett's protests Weir decides to awaken the woman to ask if she knew where any ZPMs were left. When she later wakes up she at first isn't saying anything, but she is listening and looking at them. Afterwards her only words are "It worked." until she falls asleep. Also the team finds a piece of paper with Stargate addresses written on it, including one they already been to, M7G-677. Later when the woman wakes up, she claims that she is Elizabeth Weir from an alternate timeline who travelled through time in the past. Carson runs a DNA test on her and confirms her words, while McKay finds out that they nearly killed her when they arrived at Atlantis and cut off power to the systems that were attempting to revive her.

Later when old Weir awakes again she starts to tell her story: when her team arrived at Atlantis only the lights went on but not the consoles or the computer which is different from what happened in the current timeline. When McKay tells her this old Weir falls asleep again and when she wakes up she is brought into the conference room. There she tells how the shield of Atlantis broke down almost immediately after their arrival in the city which caused Col. Sumner and many others to drown. Also the city had no fail-safe to rise to the top of the ocean so the city slowly collapsed. In the gateroom, Rodney died by drowning. Before water engulfed the city, Weir, Sheppard and Dr. Zelenka managed to get into a Puddle Jumper that is different from the others. The pod was somehow beamed into space above the planet, where the time travel device in the Jumper was activated, causing it to go back in time 10,000 years. They were then attacked by two unknown ships (Wraith darts). Hoping for a chance to retaliate, Sheppard inadvertently activated the weapons systems, but was only able to destroy one Dart before being shot down. When Weir woke up, she was back in Atlantis, treated by a man named Janus who informed her that Sheppard and Zelenka didn't make it. She then found out that she went back in time 10,000 years. The Atlanteans then informed her of war with the Wraith; despite their more advanced technology, the Wraith are overwhelming them with sheer numbers.

Weir was later brought before the council and she asked if they would give her a ZPM, and use the time machine to send her back to the precise moment when her team arrived through the gate, but they refused. They then ordered the time machine destroyed, and offered her to join them in returning to Earth. Only Janus, the inventor of the time-travelling Puddle Jumper, helped her. He informed her that the power generation capabilities of the city might be extended by using a single ZPM at a time, as opposed to the normal configuration of all three simultaneously. He devised a fail-safe to allow the city to rise should his plan fail and power drain to a critical level, and placed Dr. Weir in a stasis pod. The pod is set to bring her out of hibernation every 3,300 years or so, enabling Dr. Weir to rotate the ZPMs over the next 10,000 years.

When all the Ancients left, Weir set the city to slumber and nervously went into stasis. Back in the present the young Weir thanks her and her older self tells her that the gate addresses on the piece of paper she had lead to Ancient outposts with ZPMs. Young Weir informs Rodney and Sheppard about it while back in the bed the old Weir dies. Later the young Weir sprinkles the ashes of her older self from the earthenware pot she got from the Athosians over the city.

Quotes
Dr. McKay: According to the database, she's been in there for ten thousand years.

Dr. Weir: Ten thousand years?!

Maj. Sheppard: Doesn't look a day over nine thousand.

(Beckett is told to rouse his "very" elderly patient)

Dr. Beckett: Ten thousand years… d'you expect her to dance a bloody jig?

Lt. Ford: Is time-travel possible?

Dr. McKay: Well, according to Einstein's General Theory of Relativity, there's nothing in the laws of physics to prevent it. Extremely difficult to achieve, mind you – you need the technology to manipulate black holes to create wormholes not only through points in space, but time.

Maj. Sheppard: Not to mention a really nice De Lorean.

Dr. McKay: Don't even get me started on that movie(Back to the Future)!

Maj. Sheppard: I liked that movie!

McKay: The Puddle Jumper they escaped in must have been some sort of a time machine. It had to have an additional component built into it.

Sheppard: Flux capacitor!

McKay: ...Yeah.

Dr. McKay: I died?!

Alternate Weir: You never gave up trying, right until the end.

Dr. McKay: (shocked) Well, a man wonders how he would choose to go out, given such dire circumstances. Now I know.

Alternate Weir: Trying to save the lives of others.

Sheppard: (smug) But ultimately failing!

(upon learning that Alternate John died)

McKay: (smugly grinning) Ha! Ah, the bitter taste of ultimate failure, hmm?

Sheppard: Well, if you’d just figured out how to fix the damn shield in the first place, none of us would have died.

(Alternate Weir smiles at their bickering)

McKay: I did everything I could, including valiantly attempting to save your sorry-

Weir: Gentlemen, focus.

Teyla: Some sort of laboratory.

McKay: We've come across dozens of those, the city's full of them. Something unusual about it?

Sheppard: (finds someone in suspended animation) I'd have to say... yes.

Title reference

 * The episode title refers to the last two lines from Robert Frost's poem Stopping by Woods on a Snowy Evening out of his 1923 collection New Hampshire, "And miles to go Before I Sleep/And miles to go Before I Sleep." In the poem, a traveller rides through a forest which gets snowier every minute, and he cannot really rest until he reaches the forest owner's place, his goal, as he promised; Weir's long watch over Atlantis can be substituted for the journey in the poem. A full version of it with rhyme scheme can be found on University of Toronto Representative poetry online.
 * This is one of two episodes in the Stargate canon with a title referring to a poem by Robert Frost, the other one being the SG-1 episode The Road Not Taken.