Picard and the crew are summoned to San Francisco to evaluate a discovery of extra-terrestrial life on Earth that dates back to the late 19th century. Triolic waves, a rare energy source employed by very few species, have been detected around the city. The Captain wonders why his crew has been summoned instead of one of Earth's more qualified scientists. He is shocked to learn that the U.S.S. Enterprise has been included because Data's head, old, dusty and dead, was found among the ruins of some 19th-century artifacts. The crew finds it hard to accept Data's supposed death, but Data is typically matter-of-fact, explaining that at a future date he will transport back to 19th-century Earth, where his death will occur. Meanwhile, Geordi concludes that the only species that uses triolic rays and is capable of assuming human form on earth exists solely on the planet Devidia II. The Enterprise immediately sets course.
Upon their arrival, Picard sends an Away Team to investigate, but insists Data stay aboard ship. Troi senses human lifeforms, but no one is physically present. The crew concludes that the lifeforms are a fraction of a second out of phase with them. Since Data is the only hope for manipulating the distortion in timing, he beams down, and immediately sets up a forcefield. He soon disappears inside the field, but communicates with the rest of the Away Team, describing the unusual alien lifeforms he sees. Suddenly, an explosion occurs, and Data is gone. Lost from Devidia II, he reappears in San Francisco, circa the late 1800s.
The stranded Data quickly adapts to his surroundings. He wins needed funds in a barroom poker game, gets a hotel room and sets out to build a communications device to get back in touch with the Enterprise.
Back on the Enterprise, the crew concludes that the aliens pose a real threat to 19th-century Earth. They realize they must join Data there in trying to stop them, even if they, like Data, are doomed to die. Geordi begins work on a copy of the device that created Data's force field, hoping to make it large enough to transport an entire Away Team. Later, in Ten-Forward, Picard is unnerved by a conversation with Guinan, who insists he break with tradition and accompany the Away Team back to the 19th century. Although she can give him no explanation, he realizes she knows something. At the same time, back on Earth, Data is surprised to see a picture of Guinan in the local newspaper.
Assuming she has joined him from the future, Data tracks Guinan down at a literary reception where she is playing hostess. Guinan fails to recognize Data, but she is not shocked when he tells her that they serve together on the same starship in the 24th century. She listens with great concern to his story, subtly revealing that she, too, is not from Earth. Unfortunately, Mark Twain, the honored guest at Guinan's reception, overhears their entire conversation. Meanwhile, on the Enterprise, Geordi is able to complete his device, and an Away Team led by Captain Picard transports to the 19th century.