Imagine that you hit a deer with your car. You don't suffer any physical harm whatsoever. Your car suffers cosmetic damage, but you have insurance. So the question is this: are you the type to feel lucky to be alive? If you had been driving faster or had hit the deer at a different angle, you could have been killed.
Or are you the type who feels disappointment and regret? If only you'd never left the house? If only you'd made that pit stop? Why did you pick this weekend to visit Scotty?
These "If only" statements on what might have altered your outcome are all examples of counterfactual thinking, but they reflect two very different attitudes. That the same event can make some people feel satisfied or maybe even excited, while others experience regret, continues to elude psychologists.
What is clear is that while thinking on the bright side will probably put you in a better mood, thinking about what you could have done differently to have produced a better outcome is valuable too.
In a study, people were asked to un-scramble anagrams and then write some counterfactual thoughts. Some people were asked to think positive about what they accomplished, others to write "if only" thoughts about what they could have done differently to improve their performance. In a second anagram test, those participants who were asked to think about how they could have performed better, did indeed perform better--significantly better than the other participants.
It looks like dwelling on how we could have done better can help us to learn from our actions, so that we may "do better" in the future.