“Window of Opportunity” is episode six of season four of Stargate SG-1.
SG-1 are on a world whose sun is giving off a Coronal Mass Ejection of some size and potential danger.
Daniel is zapped by the person he is working with, Malachai, whilst they are examining some ruins with inscriptions related to the Ancient language, who then operates a device which interfaces with the stargate.
O’Neill and Teal’c are then hit by a beam generated by the machine and the stargate. They both end up back before the mission actually started, although they do not seem to be physically transported, only being at that time with memories of events that haven’t happened yet.
Then when they get up to the point in time when they were sent back, it happens again. And again. And again. And again.
Kind of lucky that SGC are used to weird things happening.
This is the first appearance of Ancient technology that doesn’t work correctly, something that was a constant theme in Stargate: Atlantis.