For me, the acceptance is the key to overcoming such memories. Usually, banging the head occurs when you cannot accept the past. In order to get over it, you have to first accept the reality. It is like you say to yourself, yes that thing happened - I did something stupid, and it had such and such consequences. Then think what was the factual outcome (e.g. broken vase), and was the imaginary outcome (ones you cannot know for sure, e.g. my father thought I gone mad). Find which part triggers severe self-blaming. This is the part you might not be accepting. Then try to accept all parts as reality (because there is no point in denying reality, it won't go away), think of best and worst possibilities for imaginary outcome and accept them as reality.
If you are blaming yourself for what you did, try to understand why you did that, and accept the situation, e.g. yes, I was young and impulsive, or yes, I made an error of judgement, etc. and accept it. Usually, head banging diminishes after accepting that things did go wrong. Acceptance frees you from the past.
DISCLAIMER: it's my personal experience, not supported by any research.