When coil is moved towards a stationary magnet, the magnetic field associated with the coil will change and so current will be induced in the coil. This causes galvanometer to show deflection in one direction. Now when coil is moved away, the magnetic field will decrease and so current induces in the opposite direction causing galvanometer to show deflection in opposite direction. The phenomenon is electromagnetic induction.