Can I transfer from Pokémon Moon back to Pokémon X? [duplicate]
Solution 1:
Unfortunately No.
Pokemon X is a Generation 6 game, Pokemon Sun is Generation 7. One-way transfer exists for moving your Pokemon from Gen 6 to Gen 7 but the reverse is not possible.
Here's a visual guide for using the Pokemon Bank with various Pokemon games, from the Official Pokemon site:
As you can see, once a Pokemon is on to Sun/Moon or Ultra Sun/Moon, it can't go to an earlier generation game.