The best thing to do in this situation is
- give the guy a day off
to compensate for the time.
I would say DON'T give a gift or money. If you do that, the person will continually work late to get gifts and money.
Give them a day off, tell them to make sure it doesn't happen again, and as the team lead make sure it doesn't happen again.
Note that of course
None of this should ever happen - obviously
Setting aside a crap, disorganized company, any programmer who works late is 20 years out of date. Nowadays any programmer who works "late" is seen as: not having a clue. "Cowboy" scripts, "hero-slop" programming, and "extreme! hobbyist! enthusiasm!" is not software engineering. There's a reason everything used to crash all the time 20 years ago.