The Prophet ﷺ ruled that the ruqba belongs to the one to whom it was given.
أخبرني محمد بن علي بن ميمون قال حدثنا محمد وهو ابن يوسف قال حدثنا سفيان عن ابن أبي نجيح عن طاوس عن رجل
أن النبي ﷺ جعل الرقبى للذي أرقبها
[Hasan] Ahmad reported it, 5/186, 189, from the hadith of Ibn Abu Najeeh with this chain, and it is in al-Kubra, no. 6538. Sufyan is Thawri, and the man is unidentified, and the hadith has corroborating narrations.