Mistakes are an inevitable part of being human, and they can be useful when we see them as opportunities to learn.
When we were thinking about Growth Mindset, we talked about seeing mistakes as a natural part of learning and growing. This is as true for interpersonal missteps as it is for debugging code.
As we just discussed, refusing to acknowledge that we hurt someone can do them even further harm. It can also hold us back from growing and developing important skills. It's very difficult to learn a better way of handling a situation if we refuse to acknowledge that there was anything wrong with our original approach.
If you ignore a bug in your code that negatively affects user experience, you unnecessarily limit how useful your program can be.
Just as we can observe the way a program is not behaving as expected and use those observations to make adjustments to our code, we can use observation to debug our own behavior as well.
If you say something that you expect to get one reaction but instead the person you're speaking to reacts in a way you didn't expect, you can:
Observe the difference between the expected reaction and the actual reaction
Reflect on what you said and try to identify what aspect(s) of it might have produced the difference
Try a different approach in the future, basing your changes on what you think might have gone wrong
Of course, if you feel comfortable and you don't think it will create a harmful situation for the other person, you can gather additional information by acknowledging the person's reaction and asking what would have led to a better experience for them.
This process of trying something out, observing how it goes, and adjusting your approach based on the results is sometimes called Self-Regulated Learning.