apologize to your girlfriend first, then sit down with her and have a
real conversation. Explain to her your feelings and how that lead to your actions. Explain to her that you understand that you have made a mistake, and apologize once again.
Communication is key if you want to have a lasting and meaningful relationship.