Command Z for developers

If your using GIT, your going to love this:

git reset HEAD~1

That will take you back to your last commit while leaving your working directory (files) alone. This is great for if you make a commit but missed something, you can git reset HEAD~1, apply the fix and recommit the changes. Please note this should only be done when you are working with a local copy that has not been pushed or shared with anyone.

Gitting Advanced
# Keep the files added to the index and ready for commiting
git reset --soft HEAD~1

# Overwrite any changes the the files since the last commit
git reset --hard HEAD~1
One more thing…

Need to go back to a specific commit? Just use the commit’s SHA hash instead of HEAD~1:

git reset --hard 9748bc01c6ef45ef7f824c6f2bd6052f0d8b9691

Protip: You can find your commit hash using git log.