In the 7th year after Hegira, the Prophet of Islam (PBUH) together with 1600 soldiers departed to conquer Khyber Castle which was located 200 kilometers from Medina.
Muslims stayed in deserts around Khyber and could not conquer the castle. They were short of food and had to eat the meat of Makroh animals such as horses and mules. In this condition, a shepherd who was looking after sheep belonging to Jewish owners came to the Prophet (PBUH) and converted to Islam, and said: These sheep belong to Jewish owners and I want to give them to you. The Prophet (PBUH) in a clear and exact manner told him: These sheep given to you in trust, and in our religion, breach of trust is not allowed. It is necessary for you to take all the sheep to the castle and return them to their owners. The shepherd obeyed the order of the Prophet (PBUH) and returned all the sheep to their owners and returned to join Muslims [1].
[1] Seerah Ibn Hisham, Vol. 3, Page 344.
Source: en.shafaqna.com