The Prophet ﷺ said to them, "Release yourselves from your ihram by performing tawaf around the House and walking between Safa and Marwa, then trim your hair. Remain in a state of ihlal until the Day of Tarwiyah, then enter into ihram for the Hajj."
… فقال لهم (يعني النبي ﷺ): أحلوا من إحرامكم بطواف البيت وبين الصفا والمروة وقصروا ثم أقيموا حلالا حتى إذا كان يوم التروية فأهلوا بالحج.
Bukhari related it in the Hajj chapter (1568), and Muslim in the Hajj chapter (1216), both from the hadith of Abu Naeem, who said, Abu Shihab narrated to us, saying, "I came to Makkah performing tamattu with an umrah, and we entered three days before Tarwiya. Some of the people of Makkah said to me, 'Your Hajj will now become a Makkan Hajj.' So I went in to Ataa to ask him for a ruling, and he said, Jabir bin Abdullah narrated to me that he performed Hajj with the Prophet ﷺ..." the hadith.