How to turn a situation around requires a lot more information about the situation, or else you'll just get general advice that may or may not apply to your specific situation.
I assume you got angry, yelled or insulted somebody. I suppose the first thing to do would be to apologize (textbook). If that's not an option, attempt to restrain your temper for a while (wait it out). Maybe focus on your job and prove despite your lack of tact or social skills you are an invaluable worker (appeal to boss).
Again, this is rather general advice that may or may not be helpful depending on your situation. Who you are, what happened, what you're able to do, are very important things to consider.
I was not the best worker, but I tried and produced some results. Also when I left I then sent a letter to all of my co-workers thanking them for all they taught me, putting up with my short-comings, and that I wished them all the best.
_________________
AQ:41
EQ:86
Your neurodiverse (Aspie) score: 130 of 200
Your neurotypical (non-autistic) score: 63 of 200
You are very likely neurodiverse (Aspie)