Withdrawal of FIR and divorce case

I have been married for 2years. Everything was fine between us until July this year, when my husband started to drink heavily and abuse me every other night. In September, fed up of the violence, I left my husband’s house and started staying with my parents. After around 5days he came to my parents’ house to take me back. But the situation turned ugly, and my parents decided to call the cops. I filed an FIR at the police station stating harassment, manipulation and threat to life. He was put behind bars for 24hrs. He has restraining orders. This case is going on in the court. I filed for divorce as well on the same grounds. Although he wasn’t allowed to talk to me, we were still in touch. He started seeking help for his alcoholism soon after his arrest. Its 2months and he is sober. He is guilty for hurting me. And I still love him lots. I’ve known him for really long and this is the first time he has behaved this way. I want to give our marriage another chance. I want to withdraw the FIR as well the divorce. How should I go about? I want to know the detailed procedure.