Whoever stones the Jamaraat on the second day of Eid al-Adha before noon has to repeat the action after noon on that day. If he did not find out that this was wrong until the third or fourth day, he should go back and stone them after noon on the third or fourth day, before doing the stoning for that particular day on which he remembered that. If he does not find out until after sunset on the fourth day (i.e. the thirteenth of Dhu’l-Hijjah) then he should not do the ramiy (because the time for doing the Ramiy ends when the days of Tashreeq end), and he has to offer a sacrifice in the sanctuary (of Makkah) and give the meat to the poor.
And Allaah is the Source of strength. May Allaah send blessings and peace upon our Prophet Muhammad.