If I'm understanding correctly, you banked a bunch of pokemon, ended up withdrawing them on your cart, and then overwrote that save file?
Unless you have a copy of an older save somewhere, I think you might be out of luck (always make backups. WIth JKSM i backup to a MAIN folder, and only...