Sahih Muslim | Book 2 | Hadith Number 524

Narrated by The son of Mughira b. Shu'ba
The son of Mughira b. Shu'ba reported: The Messenger of Allah (may peace be upon him) went out for relieving himself. Mughira went with him carrying a jug full of water. When he (the Holy Prophet) came back after relieving himself, he poured water over him and he performed ablution and wiped over his socks; and in the narration of Ibn Rumh there is "till" instead of "when".