(covers information from several alternate timelines)
In 2344, the USS Enterprise-C drifted through a symmetrical temporal rift, which itself was formed through the intense energy discharges of weapons fire as the ship defended the Klingon outpost at Narendra III from a Romulan attack. Emerging 22 years later, the Enterprise-C encountered the Enterprise-D, the vessel's immediate successor. Sensor readings taken by the Enterprise-D indicated that the temporal rift was the formation of a Kerr loop from superstring material, and that the energy from the weapons fire was the catalyst for the rift.
The surviving crew of the Enterprise-C discovered that, in their absence, negotiations with the Klingon Empire had broken down, and the Federation was on the brink of losing a twenty-year-long war with the Empire. Based on the unique perception of Guinan, the Enterprise-D crew realized that, as a result of the Enterprise-C traveling through time, an alternate timeline had been created, and that the Enterprise-C had to be returned through the rift, where their heroic sacrifice in defense of the Klingons would avert the war. Although returning to the battle would mean their almost-certain deaths, the Enterprise-C crew elected to return, and arrived at almost the exact moment from which they had originally departed. The Enterprise-C's actions in the past had the effect of returning the timeline to normal, leaving the crew of the Enterprise-D with no memories of what had transpired in the alternate timeline. (TNG: "Yesterday's Enterprise")
In the 29th century, Federation timeships utilized artificially-generated temporal rifts to travel through time, as part of their efforts to protect the timeline from temporal incursions. One such rift was encountered by the crew of the USS Voyager in 2373, when Captain Braxton traveled back in time in the Aeon to destroy Voyager, believing that they would be responsible for a devastating temporal explosion which would destroy all of Earth's solar system. Countering Braxton's attack, the Voyager crew destabilized the rift, which pulled both ships in and sent them back to Earth, Braxton to 1967, Voyager to 1996. While there, they discovered that the Aeon had been stolen by an industrialist named Henry Starling, who was planning to take the timeship to the 29th century, where he would inadvertently cause the explosion. As Starling launched the Aeon, Captain Janeway managed to destroy it with a manually-launched photon torpedo moments before Starling could enter the rift, an act which had the effect of creating a new timeline in which the explosion never occurred. Moments after Starling's rift dissipated, a new rift formed, created by Captain Braxton's counterpart from the new timeline, who traveled back to escort Voyager to its proper place and time. (VOY: "Future's End", "Future's End, Part II")
In 2404, Janeway, by then an admiral, generated a temporal rift using a time travel device called a chrono deflector, which produced a tachyon pulse which Janeway directed to the Delta Quadrant, the year 2378. Traveling through the rift in a shuttlecraft, Janeway encountered Voyager, and instructed her counterpart to seal the rift using an antitachyon pulse. In the past, Admiral Janeway successfully collaborated with the Voyager crew to change history and return Voyager to the Alpha Quadrant much sooner than it would have without the admiral's intervention. (VOY: "Endgame")