When coding, it is typically recommended to use some sort of a version control system to keep track of code revisions. Oftentimes this can be as simple as saving code named with the date that it was written, or saving code separately for each competition. This approach is easy to implement, just establish a naming convention for the files. A useful format is YYMMDD placed before or after the file name. The afdvantage of this naming convention is that when sorted by file name, it will place dates in order.
While this technique is better than not having version control at all, it is not a perfect solution. For teams that do a lot of programming or have a lot of programmers, a more sophicated version control system should be implemented. The most popular version control software is Git. Git can seem quite complicated, but it is an incredibly useful tool and used commonly in industry as a result.