Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) says: A man came to the Prophet (peace and blessings be upon him) and said: I sacrificed before stoning. He (peace and blessings be upon him) said: "Stone, there is no harm." Another said: I shaved my head before sacrificing. He (peace and blessings be upon him) said: "Sacrifice, there is no harm." Another narration has this addition: I performed the Ziyarah before stoning, and he (peace and blessings be upon him) said: "There is no harm."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الحج / 9628