Research conducted by Brock Bastian and colleagues from the University of Queensland has found that feelings of guilt can be relieved with self-inflicted pain.

50% of the group that had treated somebody badly along with all participants who were contemplating on the neutral topic were asked to put their hand into a bucket of ice water and keep it in there for as long as they could. The rest of the participants were asked to dip their hand with a bucket of lukewarm water.
Researchers said, “Participants who wrote about an unethical behavior not only held their hands in ice water longer, but also rated the experience as more painful than did participants who wrote about an everyday interaction,” researchers said.
This means that experiencing pain relieved psychological pressure and feelings of guilt .
Source-Medindia