Experiencing a green afterimage of a red object is most easily explained by using opponent process theory.
The opponent process theory suggests that one color pair dominates the other color. For instance we often see yellowish-greens and reddish-yellows, however, we never see reddish-green or yellowish-blue colors. The hypothesis was originally suggested in the late nineteenth's century by the German physiologist Ewald Hering.
The opponent process theory is based on the human visual system and according to the theory the interpretation of the color is done by the photo-receptors rods and cones in the human eye.
This theory states that the perception of color is governed by the two opponent system which includes - a red-green, a blue-yellow and a black-white mechanism.
Any activity in one of these restricts the activity in the other.