Once upon a time, there was a rich person who used to donate a great amount of money in charity to needy people. He believed that the more charity he will do, the more good karmas will collect in his accounts and at the same he will be famous in his country too. All his life, he was doing all the good deeds to go to heaven and get a name and fame in his country.
When his death day arrived, he was taken to hell. He was disappointed because he was expecting to be in heaven. He complained to god for such an injustice done to him. Then angels of heaven told him that no doubt he has done lots of good deeds and charity but his intention was not pure and selfless. His deeds were inspired by greed to get a name, fame and go to heaven. So, that’s how he understood his lesson of selfless service.
Such in the case of a bad deed, if by mistake something bad happens by you but your intention was not bad to harm or hurt anybody. In that case, also, that deed will not be counted in your negative karma.
Moral: No matter what you do, there must be a good pure intention behind it. Every time, you do something, pause and check why I am doing this. The intention of doing a deed is more important than the deed itself. Be a giver. Help people without expectation in return and forget it immediately. God has given you a chance to help people, don’t miss that opportunity.