Why in the fvck did you get out of the car? That made everything he did justified. NEVER AND I MEAN NEVER get out of the fvcking car. Also, keep your goddamn mouth shut when he is talking to your friend. If he wanted to talk to YOU he would have ASKED you. He didn't, so shut the fvck up. When I say justified... he probably felt you were about to harm him. What he did was WRONG and out of line IF and only if your side is the actual true side of what happened. If so, then I would file a complaint, but now you have fvcked yourself by getting out of the car. He was out of line and you were out of line. Why not get the car # off the side of the car? You confronted him and almost got your ass beat. You need to learn how to manage situations because you went about it the wrong way. File a complaint but you will face retaliation whether you like it or not. The thin blue line is NOT something you want to face. I am not trying to be an asshole, but rather give you a STRONG dose of reality. You erred in this encounter and so did the police officer. Your behavior led to his, and you were both wrong. Also, NEVER ask for the badge number. Ask that a supervisor come to the scene, get the car # and tag or drive the local station. What you did endanger both you and the officer and led to you being physically restrained.
File a complaint, but it will fvck you as much as it fvcks him. He may face disciplinary action or lose his job, but his fellow officers will remember. I am not taking sides here, but telling your reality.