Jabir (may Allah be pleased with him) says that the Prophet (peace and blessings be upon him), having done the stoning, sat down for the people. A man came and said: I shaved my head before sacrificing. He (peace and blessings be upon him) said: "There is no harm." Then another came and said: I shaved my head before stoning. He (peace and blessings be upon him) said: "There is no harm." That day, whatever he was asked about, he (peace and blessings be upon him) said the same: "There is no harm."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الحج / 9630