It was narrated from Umm Salamah (may Allah be pleased with her) that Prophet Muhammad (peace and blessings of Allah be upon him) said, “When you see the new moon of Dhul-Hijjah and one of you wants to offer a sacrifice, let him refrain from (removing anything) from his hair or nails”(Muslim). The majority of scholars, with the exception of Hanbalis and Ibn Hazm, agree on that it is only recommended for the one who wants to offer a sacrifice to refrain from removing anything (hair or nails) when he or she sees the new moon of Dhul-Hijjah.
Additionally, even the Hanbalis who say that it is obligatory do not invalidate one’s sacrifice if he or she cuts his or her hair or nails.