“The Daedalus Variations” is episode four of season five of Stargate: Atlantis.
The Daedalus suddenly appears in orbit around Atlantis’s planet – only it is also in the Milky way. McKay, Sheppard, Ronon and Teyla investigate it and find that this Daedalus is empty and damaged, although there is another Jumper in the F-302 bay.
This Daedalus is from another reality. On it they discover the bodies of themselves – from yet another different reality. The ship is randomly jumping between different realities, some quite dangerous. Tinkering with things damages the drive, leaving them with only a limited number of jumps before they are permanently stranded in another reality.
Pretty constant action as they try to solve a problem that has already defeated them (in another reality) whilst running out of time.