The mitzvah of Sefiras Haomer is to count the days and weeks from the second day of Pesach until Shavuos. One is required to count sefira at night. We learn from the word temimos that optimally one should count at the beginning of the night so that the entire night can be counted.
One who forgets to count sefira at night may count during the day without a bracha, and then continue counting the rest of the days with a bracha. If one forgets to count sefira at night and does not remember to count the following day before nightfall, he may not count with a bracha thereafter.
The following is an interesting question that can commonly arise: One forgot to count Thursday night and did not remember to count during the day on Friday. He then accepted Shabbos early and reminded himself afterward that he had not counted sefirah. While it is technically still the day (it’s still light outside), this individual has already brought in Shabbos. Do we already consider it nighttime, rendering it too late for him to count Thursday night’s requirement – and he thus may no longer count with a bracha? Or does the fact that it is actually still daytime enable him to count, even after he has accepted Shabbos?
In answering this question some Achronim refer to a similar halacha from the Taz. The Taz (Teshuvos 600) discusses a scenario where a community did not have a shofar on Rosh Hashanah, which fell on Thursday and Friday. After the community accepted Shabbos early, a non-Jew brought them a shofar. The question was, do we still consider it daytime and thus the shofar can still be blown, or is it nighttime and there is no longer a mitzvah to blow shofar?
The Taz gave two reasons why they could blow shofar. First, accepting Shabbos is similar to making a neder, whereby if it was done mistakenly it is not valid. Since the community would not have accepted Shabbos if they knew that they would be receiving a shofar afterwards, the acceptance was done mistakenly– and is not valid.
Second, the Taz, quoting the Beis Yosef in the name of the Smag, says that in regard to calculating the eighth day for a bris milah we only look at whether it is actually day or night. It does not matter if one davened ma’ariv or accepted Shabbos early; if it is still day the bris will be eight days from the day, not from the night. The Vilna Gaon explains that mitzvos that are not dependent on Shabbos, even if one accepts Shabbos early, are considered as if done during the day. Based on this the Taz ruled that they could blow shofar – even after accepting Shabbos.
Rav Moshe Feinstein (Igros Moshe Orach Chaim 4:99:3) discusses whether the Taz’s ruling can be applied to the question of sefiras ha’omer. The first point that the Taz used to permit the community to blow shofar after they accepted Shabbos early was that it was considered that they had mistakenly accepted Shabbos, since they would not have accepted Shabbos had they known that a shofar was going to be brought. Rav Moshe says that this reasoning can only apply if one merely accepted Shabbos (i.e. said “Mizmor shir l’yom haShabbos) but has not yet actually davened ma’ariv. However, if one already davened ma’ariv, we will not consider the acceptance of Shabbos to be accidental. This is because there are several variations from the Taz’s scenario. In the Taz’s example, the ruling affected an entire community. When an entire community mistakenly accepts Shabbos early, even if they davened ma’ariv, they would not repeat shemoneh esrei. Whereas an individual would be required to repeat shemoneh esrei if he mistakenly accepts Shabbos (see Shulchan Aruch Orach Chaim 263:14). Therefore, if we consider the individual’s acceptance of Shabbos to have been done mistakenly, it will result in rendering the seven brachos that he davened in shemoneh esrei to be brachos levatalah – since he must repeat shemoneh esrei.
Rav Moshe opines that we will not assume that in order to fulfill a mitzvah m’d’rabbanan (according to many opinions sefiras ha’omer is only m’d’rabbanan nowadays) one would not have accepted Shabbos, if by doing so we create seven brachos levatalah? And perhaps even if it was in order to gain a mitzvah d’Oraisa we would not consider his acceptance of Shabbos to be mistaken, since this would leave him with seven brachos levatalah.
In other words, in order to nullify one’s acceptance of Shabbos we must weigh all of the affects it will have and determine whether it is beneficial for him.
Based on this I would venture to say that it would depend on what day of the omer this occurred. There are seven brachos in the davening on Shabbos. Additionally, there are names of Hashem that may only be said in a bracha; otherwise they are levatalah as well. In total there are 26 brachos and names levatalah if the acceptance of Shabbos is considered nullified. If this scenario occurs after the 27th day of the omer, the scale is tilted in favor of considering the acceptance of Shabbos b’taos. Since if one does not count sefirah for an entire night and day he has lost the mitzvah, and all of the brachos that he recited until that day are retroactively levatalah, it would be more beneficial for him to nullify his acceptance of Shabbos and remain with fewer brachos levatalah.
NOTE: Concerning the halacha in this circumstance Rav Moshe rules, based on the second reason of the Taz, that (regardless of what day in the Omer it is) even after one has davened ma’ariv, he may count the sefirah of the previous day – provided that it is still daytime.