Tomorrow Is Yesterday (Star Trek)

On stardate 3113.2, the Federation starship USS Enterprise is thrown back in time to Earth during the 1960s by the effects of a high-gravity "black star". The Enterprise ends up in Earth's upper atmosphere, and is picked up as a UFO on military radar.
A U.S Air Force F-104 interceptor piloted by Captain John Christopher (Roger Perry), is scrambled to identify the craft. The pilot, surprised to see the strange craft above him, is ordered to stop the Enterprise from escaping. Captain Kirk uses a tractor beam on the jet, which accidentally tears the plane apart. Kirk orders the pilot to be transported aboard the Enterprise to save him.
The man is at first confused by his new surroundings, then amazed by what the future holds, and impressed and awed when he discovers that Enterprise is one of 12 such starships under the authority of a combined service and that the computer calls Kirk "Dear", having been overhauled on the female-dominated planet Cygnet XIV (the technicians there thought the computer needed a personality).
Fearing Christopher could disrupt the timeline if returned to Earth after glimpsing the future, Kirk decides Christopher must stay with the Enterprise. After Science Officer Spock later discovers that the pilot's own as-yet-unborn son will play an important role in a future space mission to Saturn, Kirk realizes he must return Christopher to Earth without any knowledge of Enterprise or other future events.
After learning of the existence of film taken of Enterprise by Christopher's wing-cameras, Kirk and Lt. Sulu beam down to the airbase to recover it. Upon obtaining the sensitive computer-tapes, Kirk is captured and disarmed by an Air Policeman.
When Spock attempts to contact Kirk, via communicator, the policeman accidentally activates an emergency-signal and he is immediately beamed aboard. With yet another abducted and confused native to deal with, they confine him to the transporter-room.
Spock, Sulu, and Captain Christopher, knowledgeable of the base's layout, beam down to find and recover Kirk. After Kirk's guards are subdued, Christopher grabs one of their guns and demands to be left behind. Spock, out of the room, has himself transported to a position behind Christopher, where he disables him with a Vulcan nerve pinch.
After they return to the ship, Spock and Chief Engineer Scott inform Kirk of a possible escape method by slingshotting around the Sun to break away and return to their time. The maneuver is risky, since even a small miscalculation could destroy the ship, or make them miss their own era.
Kirk okays the maneuver, and time on board the Enterprise moves backwards. Capt. Christopher is beamed back to his fighter jet at the instant he first encountered Enterprise, preventing any evidence of the ship being produced, which somehow erases his memory of his time on the Enterprise,and the sighting is written off as just another UFO. The Air Policeman is also returned to his own time, just moments before he first stumbles upon Kirk and Sulu, and somehow his memory of his Enterprise visit is erased, too. Enterprise then successfully returns to the 23rd Century, in the right time.