Game Of Thrones Season 7: 7 Theories On How Gendry Will Return
3. He Rejoined The Brotherhood

Speaking of true friends, Gendry previously felt a great loyalty to the Brotherhood Without Banners. Although initially a prisoner of theirs, taken along with Arya and Hot Pie after escaping from Harrenhal, Gendry warms to the group and feels a sense of belonging.
He helps them out by fixing some armour and, even when given a chance to leave, wants to stay with the group, claiming they're the closest thing to a family he has ever had, and one that'd be far easier for him than living at Winterfell as a bastard.
Of course, they then sell him out and hand him over to Melisandre, who takes him back to Dragonstone and has some sexy leech-time with him, so he might not think that highly of them anymore.
But the timing is convenient, with the Brotherhood returning late in Season 6. We don't see the entire group though, so there's a chance Gendry is among them, deciding that regardless of their actions they're still the closest thing to a family he has, and his best chance of survival.
It would also put him in a position to still reunite with Arya eventually, and put the character back in line with his book equivalent, who luckily never had to suffer any of the sordid leech/rowing business.