When you fire a bullet from the gun, the gun experience a force in the backward direction. Because of this force, the gun attains a velocity in the backward direction. This velocity is known as recoil velocity.
Pbeforefire=Pafterfire
(MgVg+mbvb)beforefire=(MgVg+mbvb)afterfire
(Mg0g+mb0b)beforefire=(MgVg+mb(−vb))afterfire
0=MgVg−mbvb
Vg=mbvbMg