Similar to MS Office's undo-redo feature, Version Control allows to go back in time and review/reuse old codebase versions. There are many VCS (version control systems) out there, but some popular ones are SVN (subversion) and git
Git is the most used VCS software in the world. It allows to keep track of changes and sync teams of multiple people via a distributed network.
Each version of a project is called a commit, and each individual code-project is called repository (repo for short).
GitHub is a platform where usually developers can store their code/files using git
The project copy stored in GH is the remote repository which is used by all devs to pull/push changes.
All platforms that use git (such as BitBucket or GitLab), store the author's information of each change, be these an addition or the removal of pieces of code. This helps with (to some extent) both productivity measurements and security.
Once git is in place and everyone at the team is using it, the code is stored safely in the remote repository, from where people can pull the changes from each other.