If he is an easy-to-communicate person, you can choose to apologize in person; If he has a bad temper, you can also choose to send him an email to apologize. If he accepts, he should take the initiative to talk to you. If he doesn't take the initiative to talk to you, you should take the initiative to talk to him after one day. At this time, even if he has not forgiven you, he should not be as angry as he was at the beginning.
It doesn't matter whether you are invited to dinner or not. The important thing is that after you get his forgiveness, you must not make the same or similar mistakes again, because if you become a recidivist, the possibility of being forgiven is very small! Remember!