I know exactly what you mean, because a similar thing happened to me the other day. My horse (who is usually really laid back) started kicking out when I went to put her back boots on, not standng still while I got, then she was completely ignoring in the arena, and I could feel myself getting more and more wound up, so I got off and led her back to the yard, because I just wasn't in the mood and it wasn't fair on her, then she started being naughty while I lead her (trying to cut across me in trot and setting her neck against me) and I did lose my rag with her
Afterwards, I felt devestated at how I had handled the situation, because that isn't how I work with horses, I believe in being quiet and patient (Intelligent Horsemanship), the Monty Roberts techniques. When you feel angry or frustrated at him, just close your eyes, clear your mind and take deep breaths, maybe think of a happy memory with your horse, and if you don't feel like riding, don't.
I felt so angry at myself, because I knew it was my fault, she could sense how I was feeling and she was just reacting from that, so when I had untacked her, I gave her a big hug and I told her I was sorry, maybe that sounds a bit crazy, but I think she knew, because she was lovely after that :) So don't give up, we all have bad days and good days. We all make mistakes, but you learn from them and move on
Hope this helps x x x