Law 5 answers this directly.
Section 2, Decisions of the Referee provides that
The referee may not change a restart decision on realising that it is incorrect or on the advice of another match official if play has restarted or the referee has signalled the end of the first or second half (including extra time) and left the field of play or abandoned the match. However, if at the end of the half, the referee leaves the field of play to go to the referee review area (RRA) or to instruct the players to return to the field of play, this does not prevent a decision being changed for an incident which occurred before the end of the half.
In effect, the referee can change a decision regarding something that happened before the game ended, even though they have already indicated full time, as long as they're still on the field of play (or have left it to conduct a review or to recall the players).