In this situation when someone pushes your buttons or does something that maybe embarrasses you in public whether you are wrong or right, it is always a good idea to simply stop and listen to what they have to say. Then calmly respond by saying, You may be right I didn't think of it like that.
With that statement she has been heard and you have not agreed with her but are willing to consider her feelings. That is important if you want to stop the situation from getting worse and now the confrontation is over.
At a later time you can decide if you want to take her advice and if she had a valid point. If she a good point but confronted you inappropriately then that would be her problem and by you not reacting and instead taking the high road you are not continuing with or perpetuating that behavior.
We all get into situations where we wish we wouldn't have reacted to something said, but we did. I look at that as an opportunity to do it different next time by doing exactly what you did Timbre talking it over with me or someone and being open to a different response when in a similar situation next time. This is how we all learn and grow.
Good for you! I wish for all the happiness the Universe has to offer and thanks for sharing your question.