I use branches a lot with Git, as I find them easy to understand and a great tool for organizing. If you want to easily switch back and forth between versions of your code base for testing, you can just create a branch with a particular commit:
git checkout -b before-refactor a8b912c0ebdce6173f6e7af5d93fafc0f50175c0
This also lets you easily compare versions by diff
ing the branches:
git diff master before-refactor