If you are working with many text files, you should track your changes in a version control system. This helps maintaining changes and keeping backups.
Git is a very widly used and easy one.
Create a new local repository and ignore all *.gz files and everything below tmp/
git init nano .gitignore *.gz tmp/
The pure basics (optimized)
git staus git add * git commit -a -m "comment" git log
Create and switch to a branch
git branch new-feature git checkout new-feature
"checkout" is like read from repository.
Merge branch master with an other branch
git checkout master git merge new-feature
Delete a branch
git branch -d new-feature
Undo a file
git checkout $file
Undo a branch