If you insulted a girl, either purposely or inadvertently, don't worry. She's not going to base her entire opinion on you on one insult, and you may be able to come back from it with relative ease by simply apologizing. You don't have to be overly elaborate, but you do need to be honest, sincere and make it clear that your insult was out of character and not representative of who you are as a person.
Find a time and place in which you can talk to her for a couple minutes uninterrupted. You don't need a huge block of time, but you do need a couple minutes of one-on-one time so that you can have a real discussion. You also need to be alone with her because if she is in a group, she will feel uncomfortable.
List the hurtful effects of your actions when you apologize. This will show empathy and show that you are actually sorry. If you simply say that you're sorry, you'll give the impression that you're only sorry about getting caught.
Listen to her response. The apology is her opportunity to tell you how you made her feel, and an opportunity for both of you to move forward. Listen attentively and take her thoughts on board. If you can, rephrase them back to her to show that you were listening. This is why you need to get a few minutes to apologize to her.
Follow through with concrete actions. If you tell her during the apology that you are going to act differently in the future, put your money where your mouth is and actually do so.