Counterfactual thinking, or "what if" thinking, is our ability to formulate alternative scenarios to events that have already occurred. For example, one might say "if only I hadn't overslept, I wouldn't have missed my interview". Statements like this are alternative scenarios, contrary to reality, and may (negatively or positively) influence how we feel about the actual event and may further impact future decisions related to the actual event (e.g., setting 5 alarms next time). Counterfactual thinking in social interactions also seems to influence how we assign blame and responsibility. The ever present "Well, if she wasn't wearing... then..." and "Well, if he didn't run from... then..." statements have consistently shown to impact jury decision making.
Byrne, R. M. (2016). Counterfactual thought. Annual review of psychology, 67, 135-157.