Self harm tends to be a release there are alternatives such as grabbing/ trying to crush ice or hitting a pillow etc. Obviously he would need to be ready to accept/ change that pattern. The good thing is that he has told you about it so clearly feels he can confide in someone- may mean he is willing to speak to professionals about it too (counselling would be a good option if he is willing)
He clearly has something going on could it have been triggered by the miscarriage? Is he still with this girl? She likely needs support too (if not already getting it)
Seems like something has triggered his behaviour and my guess would be behaviour around the girl/ loss of the child which is devastating for anyone. As pointed out he needs support from family and friends and as you say he also needs to know this behaviour or his feelings don't mean he is a bad kid , just that he is in a bad place.
Every action has a reaction and it sound like this is what it is.