undo git commits

// deletes the last commit
git reset --hard HEAD^

// where X is the number of commits to undo
git reset HEAD~X