Here are the main points that you should include in an apology letter to your girlfriend.
I love you. Please be home. The apology letter should have one paragraph relating to the events which let to the condition that made you write the letter.
It was selfish of me to not consider your feelings and I promise to be more in tune to them. You deserve to feel appreciated and special and I want to give that to you. Now that I think of what happened, it's really something I feel horrible about.
I am sorry for keeping you in the dark like this.