I suggest you use a version control system.
Programmers are always fallible. When we work on a project, we will do requirement, design for it, start coding, then change our minds, rewrite it, go back to a previous version, and so on. If you can use a version control tool correctly, it will make...