First of all, do not expect things to be “excellent” all the time, because they won’t be. Relationships keep altering and it’s completely fine, just make you’re always doing your bit to improve things.
Secondly, you say she doesn’t want to break up which clearly means she wants you to work towards making things better. Start with your temper, make sure you never repeat this “really bad way” of behaving with her. If ever you know you’re about to lose your temper and do something you shouldn’t, just leave the room and walk away. Don’t let anyone else be on the receiving end of your temper.
Thirdly, keep communication intact and express your feelings to her as much as you can. You feel beautiful things about her and letting her know of your love will only make her feel good. Spend time with her and hug her when she`s feeling down. Little gestures like a good morning/night text, complimenting her, asking how her day was, being polite and understanding etc. go a long way in making the relationship stay longer and happier. Identify her likes and dislikes; do and talk about things that she likes. Basically, treat her the way you`d want to be treated and do not do things you wouldn`t want her to do to you. But also, don’t be too clingy or imposing. The key is to not over-do anything.
Finally, know that this relationship is not everything. You clearly like this girl a lot and want to fix things and you should work towards it, but do not let this affect you to the point that you get depressed. As much as you want her to be happy, also do things that make you feel good. Don`t let this relationship be solely about you trying to fix things and make her feel alright. Make sure that you`re happy too. Do not put all your time and energy only on this relationship.