We consider the problem of unsupervised domain adaptation (UDA) between a\nsource and a target domain under conditional and label shift a.k.a Generalized\nTarget Shift (GeTarS). Unlike simpler UDA settings, few works have addressed\nthis challenging problem. Recent approaches learn domain-invariant\nrepresentations, yet they have practical limitations and rely on strong\nassumptions that may not hold in practice. In this paper, we explore a novel\nand general approach to align pretrained representations, which circumvents\nexisting drawbacks. Instead of constraining representation invariance, it\nlearns an optimal transport map, implemented as a NN, which maps source\nrepresentations onto target ones. Our approach is flexible and scalable, it\npreserves the problem's structure and it has strong theoretical guarantees\nunder mild assumptions. In particular, our solution is unique, matches\nconditional distributions across domains, recovers target proportions and\nexplicitly controls the target generalization risk. Through an exhaustive\ncomparison on several datasets, we challenge the state-of-the-art in GeTarS.\n