Ok. You just messed up in the office. And this is something that you are ashamed of. Shame, anxiety and horror cripple you down to your knees. You probably deleted a critical file or probably abused your boss; there is still a chance of a comeback if you handle the situation right.
I would recommend that you take the following steps to recover from this:
Before you take any action, it is critical that you analyse the situation thoroughly. The last thing you need to do is act impulsively and twist things a little more. Find a corner and a friend/mentor to guide you in doing what is necessary. The whole point is to buy time for you to think before you act.
The most important thing that you need to do right now is to accept your mistake and take complete responsibility for that. A 1000 excuses might have popped up your head, but being honest is the path you want to take.
Make sure you tell them you are sorry for your action. Also, make sure that you say sorry to the person directly affected by your actions. Make the apology small and professional.
Pinpoint the origin:
It is equally important to identify the root of the problem, as it is to find the problem. Figure out what went wrong and address the issue. Was it the procedure or were you overwhelmed?
Find a Solution:
Accepting the mistake and making an apology won’t pull the tension down completely. Every error needs a remedy, and you should offer one. Tell them that you take the responsibility to rectify things and bring the, back as usual. Tell them that you have learned your lesson and won’t repeat it, for mistakes that can not be corrected.
Let your deeds do the talking:
Once your apology has been accepted, and you have been granted a free ticket, its time you get serious and tell the management how serious you are about this role. Make sure you assist colleagues and attend after office catchups and events.
Critical errors can be punishing, but there is always a scope for rectification. The right approach takes you forward, and that is precisely what you want, right? Share any such experiences that you might have faced in the comments section.