Just put a Pokemon back in a pc, then go back to riley, he should be in the excat spot you left him.