Narrated Abdullah ibn Umar: When the Prophet ﷺ wanted to relieve himself, he would not raise his garment, until he lowered himself near the ground. Abu DAwud said: This tradition has been transmitted by 'Abd al-Salam b. Harb on the authority of al-A'mash from Anas b. Malik. This chain of narrators is weak (because A'mash's hearing tradition from Anas b. Malik is not established).
The Prophet Muhammad ﷺ was known for his exemplary character and behavior, so it comes as no surprise that he would practice such humility even in private moments like this one. He was an example to us all on how to conduct ourselves with dignity at all times.