From Merriam-Webster:
Retcon is a shortened form of retroactive continuity, and refers to a literary device in which the form or content of a previously established narrative is changed. Retcons are often encountered in serial formats such as comic books or television series, where they serve as a means of allowing the work’s creators to create a parallel universe, reintroduce a character, or explore plot lines that would otherwise be in conflict with the work. Essentially, a retcon allows an author to have his or her cake and eat it too, as it enables the return of dead characters, the revision of unpopular elements of a work, and a general disregard for reality.
The term appears to have its roots in a 1973 book by E. Frank Tupper titled The Theology of Wolfhart Pannenberg: “Pannenberg’s conception of retroactive continuity ultimately means that history flows fundamentally from the future into the past.” Although Tupper’s book, which was based on his 1971 Ph.D. dissertation, undoubtedly did quite well, it is unlikely that retcon would have been so successfully integrated into our language without retroactive continuity being used by other writers.
This began in the early 1980s when the term gained some degree of currency among comic book fans. The abbreviated form, retcon, started appearing in Usenet newsgroups before the end of the decade. Retcon's noun and verb forms appeared almost simultaneously. By the turn of the 21st century retcon had moved beyond the province of the Internet, and began to surface in newspapers and books.