... depends how much you hurt them xd if its like a shove or something minor, but if its severe, i dont think someone would forgive you (depends tho and im not saying no one would forgive you) it might take a while to earn their forgiveness. if its something like feelings, again, and you might need to make it up to them by showing them that you truly are sorry (if u are)
If you didn't mean to harm anyone, apologize and make up for it. Otherwise do nothing. Don't harm others.
Personally, the best thing to do is give them space. If u have harmed someone they will not want to see you in there face 24/7. In the end, all u can do is apologize and give them time to accept it.
The obvious: apologise. That's pretty much it. Don't bug them and don't hurt them again in the future. If you've physically hurt someone, make sure they're not dying. Use first aid if you know it and call an ambulance.