Board Thread:Pokémon Help/@comment-34176387-20180204210527/@comment-27248965-20180213175900

I'm no expert in breeding, but the Developers already added a function of letting you decide if your deposited Pokemon should learn new attacks or keep old moves when you retrieve them, from Port Decca update onwards. If you choose "No", the Pokemon will keep all 4 original moves when you dropped it off.

Of course you have no control on what attacks they learnt and replaced, if you pick "Yes", it will work normally such that the topmost attack gets removed first with the new attack placed last, shifting other attacks to upper slots, and this process repeats as usual until the most recent move available depending on the Pokemon's level.