When people think about what might have been, they construct a mental representation of the actual state of affairs, and they generate an imaginary alternative by carrying out minimal mutations to it. When they think about how an undesirable outcome might have been avoided, they mutate the events leading to the outcome in regular ways, for example, they undo the more recent event in a series of independent events. W e describe a computer simulation of the cognitive processes that underlie these effects of temporality on counterfactual thinking that is based on the idea that reasoners construct contextualized models. W e report the results of two experiments that show that the temporality effect arises because the first event provides the context against which subsequent events are interpreted. The experiments show that when the contextualizing role of the first event is decoupled from its temporal order the effect is eliminated, for both bad and good outcomes. The results rule out an alternative explanation based on the idea that the more recent event is 'fresh' in mind. The context effect in temporal mutability may shed light on the remaining primary phenomena of counterfactual thinking.