3. Be consistent
If you are given a second chance, accept it gracefully, with the full intention of practicing those skills you need to develop in order to not make the same mistakes.
He might be jumpy, skeptic, leary, and generally suspicious. And he has every right to be so. You will have to earn his trust by consistently doing what you said you would do over time. Only time will tell him that you are truly repented and behaving differently, for good.
Along the way, you might even make a mistake here and there, and it might set you back a bit. Respond gracefully, with honesty, without trying to hide. Your authenticity will be all the evidence he needs to believe you are truly trying.
Time will pass, and you might not feel like you are making progress. Reconciliation does not guarantee forgiveness. You will have to decide how long you are willing to wait, and how much effort you are going to invest in earning his trust again. This is not something to punish him for - not everyone relationship survives. Your job is to be consistent, and to take care of your treasures - your emotions, your choices, your needs. So long as you do this, you'll have a chance to get him back.
4. Maintain Your Dignity
Sometimes our shame will take over and make us think that we deserve anything bad our partner gives us. We think that, because we made a mistake, we have earned all the humiliation they throw our way. This is not dignified, and it is not the foundation of any healthy couple. On the other hand, it is the very formula for abusive and destructive relationships.
Forgiveness takes time. It is a long process. However, everyone makes mistakes. Chances are that you were not 100% responsible for the demise of the relationship in the first place. He probably contributed in some way. If not, he too is human, and is capable of making mistakes. There is no reason why you should accept any form of punishment or humiliation, or any kind of retaliation. Yes, he might decide to take it slow, putting boundaries in place until he can trust you again. That would be very wise, if this relationship is going to stand the test of time. Telling his friends all about our personal life, exercising "payback" so he can get even with you, or worse - emotionally, physically, or sexually demeaning you are completely inappropriate ways to deal with anger and resentment. Do not accept anything less than an adult, dignified second-chance.
5. Work on You
Breaking habits and patterns is very difficult. This is the work of a lifetime, and it will take every human all the effort they can muster to be authentic, sincere, consistent, and content. The tendency is to want the other person to make changes, to stop this or do more of that. But we don't have control over the other individual in the relationship. All we can do is work on ourselves.
When you do the tough work of being sincere, letting go of control, being consistent and behaving with dignity, you will find that you are free. You might or might not get him back, but you will attract the right person into your life if you committ to being the best version of yourself that you can possibly be.