Well, I don't know about Git or Mercurial, but Subversion keeps track of every single change made to every file in your project. First you create a Subversion (SVN) repository on an SVN server with the beginnings of your project, and then you can download a "working copy" of the repository wherever you are. Whenever you change something, you can "commit" the changes to the repository, all of which the server keeps track of.
It's also great for (and definitely geared towards) collaborating with others. Good SVN clients (like
TortoiseSVN) have a lot of tools like Diff and Merge that show you all of the differences between two files (and files from past revisions) and merge two files non-destructively.
I'm sure the other version control systems are pretty similar.