Yesterday’s Enterprise

Star Trek: The Next Generation
Season 3, Episode 15
In this episode, there is a rift in spacetime where the USS Enterprise encounters a damaged Enterprise-C. It was thought to have been destroyed two decades ago. Randomly, Enterprise-D undergoes a radical change by forming into a warship. We now know the United Federation of Planets is at war with the Klingons. Worf and Counselor Troi both disappear from the ship and Tasha Yar is back running the tactical station after being killed years prior. Yet the crew is oblivious to the change.
However, Guinan is able to detect that reality has shifted and tells Captain Picard. She suspects Enterprise-C is outside its normal time. But Picard knows to get the ship back to the past would be suicide. Eventually, everyone realizes the timeline issue, and while on the brink of Enterprise-D’s destruction, Enterprise C goes into the anomaly that would trigger everyone to return to their timeline. Guinan, the only one aware of the rift in time, asks Geordi La Forge to tell her about Tasha Yar. Truly, it is hard to find Star Trek episodes that hit as well as this one.