Tree House of Horror VIII - S9-E4
Other mistake: In 'Homega man', Homer goes into the bomb shelter and does not shut the door, and you can still see it open for a while after he is in there. Herman does not close it behind him - you can tell by his skeleton's position. But Homer opens the door to leave the shelter after he has eaten the food, and it must have been closed for him to have survived the atomic attack, because it vaporised Herman, who was only a few feet away.
Tree House of Horror VIII - S9-E4
Continuity mistake: When Homer pulls up to the stoplight, the number of cars in front of him changes. When he first stops, there are 3. When he gets out of the car, there is only 1.
Tree House of Horror VIII - S9-E4
Continuity mistake: Mutant Moe had one red mark on his face wile talking to Homer in the church, but when everyone attacks him, he has two.
Tree House of Horror VIII - S9-E4
Continuity mistake: Homer is dancing naked in the church and has his pants on the pew. There is then a wide shot and his pants are gone.
Answer: I'm not sure if this is the one you're thinking of, but an episode of "Ray Bradbury Theatre," called "A Sound of Thunder," dealt with a similar matter: a group of hunters travel back in time to hunt dinosaurs, only to find things have changed when they get back because someone stepped on a butterfly.
Xofer