It is called recurrent backcrossing. Each generation you select for the few dominant genes of the parent B that you want to keep and cross it back to the parent A which you want most of the genetic background (or each two generations for recessive genes)
|