Set yourself to understand and empathize with her before you react.
Look in her eyes, keep your face neutral and make no reactive gestures or faces.
Every few sentences, ask her to stop, so you can see if you're getting her right.
Tell her what you heard her say and ask, "Is that what you're saying?" until she
agrees you accurately reflect her ideas.
Then say, "Is there more on this you'd like to say?"
When she's said all she chooses on the subject, summarize what she said
and say, "I imagine you felt...".
Then take your turn and respond to her concerns.
Alternate turns as speaker and listener till you work through the issue.
Tell your girlfriend that, from now on, when she's vexed with you, to use active listening instead of sarcasm.
Ask her, when she feels an impulse to be sarcastic, or when she or you notice she's becoming
sarcastic, to say, "I'm feeling (hurt, angry, disappointed).
I need you to listen actively to me; let's find a time so I can work through this feeling and feel close and loving again."
It may take a week or so of practice to get comfortable with this new way of sharing and it may take months for her to break her sarcasm habit.
Your girlfriend learned to communicate her anger through sarcasm long before she knew you, so be patient with her.