This is when Ministry of Truth comes into play. The main character's job in 1984 was literally this: rewriting history when it came into conflict with the updated "truth". Orwell didn't foresee that in a world of computers, such updates are trivially made: no need to reprint newspapers and books, since all of them are virtual.