It is tool used to track changes in code and other text files. It also provides a running history of code development and help to resolve conflicts when merging contributions from multiple sources.
It's like journal, log, or video game save points, all the changes that you have made to file are rememebered up to that point and you can go back in time to look at what things use to look like.
We make mistakes all the time, it's only natural. So when a mistake does finally happen we're able to go back in time to our older changes and use those to fix or replace our problematic code.