It was the practice of the Prophet (peace and blessings be upon him):
"Whenever he (peace and blessings be upon him) woke up during the night, he would always pass the tooth-stick (miswak) over his mouth."
Hadith Referenceصحیح الجامع الصغیر / حرف الكاف / 4842
Hadith Gradingالألبانی:حسن
Hadith Takhrij[ابن نصر] عن ابن عمر. الصحيحة ٢١١١: طب، عد.