git revert
is used to undo a previous commit. In git, you can't alter or erase an earlier commit. (Actually you can, but it can cause problems.) So instead of editing the earlier commit, revert introduces a new commit that reverses an earlier one.git reset
is used to undo changes in your working directory that haven't been comitted yet.git checkout
is used to copy a file from some other commit to your current working tree. It doesn't automatically commit the file.