Star Trek: The Next Generation/Recap/S5 E26 S6 E1 Times Arrow

The Enterprise is called back to Earth to investigate an unusual artifact - which turns out to be Data's head, apparently left untouched for five centuries. While investigating the cause behind this, Data enters a portal which leads him into 19th Century America. Meanwhile, the rest of the crew discovers that shapeshifting aliens are kidnapping human life energy from that time period and feeding on it.