How to reverse XP gain?

Hello,

Can someone help me or point me to where to start looking if I'd like to reverse the XP gain. To clarify: If a hero is level 13 and kills another hero or creep they lose xp towards getting to level 12.

Thanks in advance!