How can we complain against a police sub inspector ?

He beaten me in police station infront of the girl who was his friends sister he asked me to check my phone and i told him that it’s personal he stood up and started beating me. The case was of a fek id who was asking a girl for money but it wasn’t me. My mistake was that i tried to help her and some cheesy lines were there in chat from both side she was doing this to entrap me but i was not knowing this her half clothes were uploaded on that id and one of her friend send it to me saying that she is crying and worried about tha pictures which she send one year earlier to her boyfriend and many others but I don’t know the others. Police sub inspector took 10000 rupees from me then he leave me at the evening by threating me that you have to come whenever i will call. He beaten me badly infront of girl and some of his local friends police was in control of her . Suggest me i am preparing for my CPO exam when i will stand on my legs i want to put those culprits behind the bars legally