AbuBakr ibn AbdurRahman reported on the authority of a Companion of the Prophet (ﷺ): I saw the Prophet (ﷺ) commanding the people while he was travelling on the occasion of the conquest of Mecca not to observe fast. He said: Be strong for your enemy. The Messenger of Allah (ﷺ) fasted himself.

Narrated AbuBakr:

A man who narrated his tradition to me said: I have seen the Messenger of Allah (ﷺ) in al-Arj pouring water over his head while he was fasting, either because of thirst or because of heat.
Sunan Abi Dawud Book 14, Hadith 53