Cancel (something) out or cancel out (something)

To destroy or wipe out the effect of something.

The overeating by the girl cancelled out the benefits of her exercise.