I suggest you put things right (which it sounds like you're going to do, by taking it back) then forgive yourself.
Lots of us act out in various ways when under pressure with mental health problems. That might be doing something that's usually against our principles, and not who we want to be. It's a kind of release, I think. Something has to give, so we let part of our control snap and do something out of character.
If you do it more than once, or keep wanting to do it, then I'd seek help for it. Not to blame yourself or see yourself as mad, but to get support to work through what's going on.
If it's only once, I'd do something for closure so you can let go of the shame. Maybe write yourself a letter, light a candle, make a small donation to an appropriate charity (only if you can afford it), or take a stone and bury it - any kind of little ritual to say you recognise that under pressure you did something you regret, you put it right, and now you forgive yourself.
I'm sorry you've been having such a difficult time.