Write your girlfriend a letter where you tell her that you regret what you have done and that you will never do it again, if that is true. Ask her if there is something you can do to make everything good again between you.
Learn something for the future, so you will not destroy any more relations later on. There is a risk that in new, future relation, you will also hurt your girlfriend and destroy your changes for a happy relationship. How can you change yourself so that a future relationship will work better?