The innermost desire of every Jew, no matter what his or her outward level of observance of the Torah, is to perform G-d’s will in full. Therefore, even when we perform a commandment unintentionally, or even “mistakenly“, it is really the result of our deep-seated desire to do it.
Therefore, if a person loses a coin and a poor person picks it up, G-d rewards the person who lost the coin; how much more so will G-d bless us for intentional acts of charity and kindness! ~ The Lubavitcher Rebbe