"Time’s Arrow" is the 126th and 127th episodes overall and 26th episode of the fifth season and first episode of the sixth season of the science fictiontelevision seriesStar Trek: The Next Generation. A two-part episode of Star Trek: TNG, the first episode was a cliffhanger season finale for the fifth season and the second episode was the premiere for the sixth season.
The Enterprise is recalled to Earth on a priority mission pertaining to evidence of aliens on the planet 500 years ago. They are shown a cavern near Starfleet Headquarters in San Francisco containing relics of the 19th century, and the severed head of Data. The Enterprise crew finds evidence pointing to a race of shapeshifters and cellular fossils native to the planet of Devidia II. Taking Data's second head, the Enterprise travels to the planet, and discovers a temporal disturbance on the planet. While there are no life forms visible, Troi senses the presence of suffering humans, and the crew realizes that the aliens are slightly out of phase with time. Data notes that his android body has a phase discriminator that would allow him to see the aliens, and Captain Picard reluctantly allows him to do so. Data, once in phase with the aliens, describes them to the crew as absorbing strands of light from a device in the center of the cavern but otherwise appear benign. However, as he observes, two aliens enter a time portal that he is drawn into; Data finds himself on Earth in San Francisco in the 19th century.
Data quickly recognizes he needs money to operate, and is able to win a sizable amount beating card sharks at their own game in poker. Taking residence in a local hotel, Data claims to be an inventor, befriending the bell hop (who is in fact Jack London) to help in acquiring parts that will help him build a detector to find the aliens. Data recognizes Guinan, a long-lived El-Aurian and fellow Enterprise crew member, in a newspaper photo, and goes to a reception she will be attending. As she is speaking with Samuel Clemens (better known by his pen name, Mark Twain, played by Jerry Hardin), Data tries to ask her questions about the future believing her to have followed him back in time, but realizes that she is native to 1893 and has yet to meet the Enterprise crew; Data's language intrigues Clemens and he begins to follow Data and Guinan around.
Meanwhile, the Enterprise crew has determined how to build a similar phase discriminator to allow them to also see the aliens and go back in time to rescue Data. Guinan urges Picard to go along with the away team as, otherwise, they will have never met in the past and could change history. Picard and the rest of the away team activate the phase discriminator and see the same aliens as Data described, but discover that the strands of light they are consuming are human life forces, taken at the moment of death. The away team uses the time portal to travel back to the past to put a stop to the aliens.
Arriving in 1893, the away team quickly locates Data, who explains the current situation. Using Data's device, the team, followed by Guinan and Samuel Clemens, is able to follow the alien shapeshifters to the same cavern near San Francisco, where they discover that the aliens traveled to the 19th century to take advantage of a cholera outbreak, draining the life force from humans in infected areas to give the impression that their deaths were the result of an epidemic. In an ensuing struggle over a cane-like device used to open the portal, Data's head is severed from his body and left in 1893, and Guinan is injured. As Picard tends to Guinan, the rest of the away team, carrying Data's body which continues to grasp the cane device, follow one of the aliens to the future, with Clemens also following them. Picard learns from the other alien that should the Enterprise destroy their base in the 24th century, the strength of the time shift will be amplified, potentially devastating 19th-century Earth. Picard places a binary message using iron filings in Data's static memory to leave instructions for his crew in the future.
In the 24th century, the crew reattaches Data's other, 500-year old head onto his body, and discover Picard's message. They decide to mount a rescue mission to save Picard, but studies of the cane device reveal that due to instability of the portal, only one person can return. After seeing the wonders of the 24th century, Clemens offers to go back to save Picard. Clemens returns to the cavern in the 19th century, giving Picard a device to operate the time portal himself, and offering to tend to Guinan's wounds. Picard thanks Clemens, and explains that he wishes he could have gotten to know him better, but Clemens points out that his personality is written into his books. Picard returns to the future and, with information he learned from the alien, they are able to disable the aliens' time portal.