He came in a plane and told Jyn and Cassian that they were being rescued and was shocked that Cassian and Jyn attempted to kiss each other. He said that since their chances of survival was below 30%, he copied his memory banks into another droid they've found earlier to which Jyn said was smart. Then he told them to get to the back before Scarif exploded. They got on the back which he proudly says he feels like the wind.
how rogue one should have ended