This is set in a medieval world, where the only magic that exists is the magic of the four elements: fire, water, earth and wind.
When someone is hit by elemental magic, they sustain magical damage according to the respective element. For example when you get hit by a fireball, you will get burned by the fire. When you are hit by a blizzard, there's a chance you will get a frostbite. It's like in the real life. So there's a bit of science here, but not as strict.
However, for an important plot point, I would like this magic damage to be reversible when it is dispelled. The burn will disappear, as if you never got hit by the fireball in the first place.
How to explain this phenomenon? How can a magic system explain this?
The magic system is not set in stone, however what I have in mind is an avatar-style elemental bending. Ideally, the answer should also explain how the dispel process works after the target suffered damage.
For example: the Dispel spell uses anti magic particle (similar to anti matter). When it collides with the magic particle, both particles are destroyed.