When the Messenger of Allah ﷺ camped at al-Hijr during the expedition of Tabuk, he commanded the people not to drink from its well nor to draw water from it.They said, "We have already kneaded dough with it and drawn water from it."So he ordered them to throw away that dough and pour out that water.In another wording, the people stopped with the Messenger of Allah ﷺ at the land of Thamud, al-Hijr, and they drew water from its well and kneaded dough with it. The Messenger of Allah ﷺ commanded them to pour out what they had drawn from its well and to feed the dough to the camels, and he instructed them to draw water from the well which the she-camel used to frequent.
أن رسول الله ﷺ لما نزل الحجر في غزوة تبوك أمرهم أن لا يشربوا من بئرها ولا يستقوا منها فقالوا: قد عجنا منها واستقينا فأمرهم أن يطرحوا ذلك العجين ويهريقوا ذلك الماء. وفي لفظ: أن الناس نزلوا مع رسول الله ﷺ أرض ثمود الحجر فاستقوا من بئرها واعتجنوا به فأمرهم رسول الله ﷺ أن يهريقوا ما استقوا من بئرها وأن يعلفوا الإبل العجين وأمرهم أن يستقوا من البئر التي كانت تردها الناقة.
Bukhari narrated the first wording in the chapters on the prophets (3378), from Muhammad bin Miskin, who said, Yahya bin Hassan bin Hayan told us, who said, Sulayman told us, from Abdullah bin Dinar, from Ibn Umar, who said, then he related it.Bukhari narrated the second wording in the chapters on the prophets (3379), and Muslim in the book on asceticism (2981:40), both through chains from Ubaydullah, from Nafi, that Abdullah bin Umar informed him, then he related it.