By Newton's third law of motion , every action has a equal and opposite reaction , the gun's bullet moves forward , the gun moves backward.
The recoil of a gun means the force exerted by the fired bullet in backward direction.

This happens due to Sir Isaac Newton's Third Law of Motion, which states that every action has an equal and opposite reaction. 

As the gun exerts force on the bullet, similarly, the bullet exerts force of equal magnitude in the opposite direction. However, since the mass of gun is more, its inertia is more and so it moves with comparatively lesser velocity backwards. This is called recoil.

This recoil can be disastrous if it is not controlled. A shooter places the gun firmly to his shoulder, so that the force of the recoil is absorbed the muscles of the shoulder. If it is not held so, the gun will move backward and most probably damage the face of the unfortunate shooter.