undo a commit with reset code example
Example 1: undo reset commit git
git reflog //to get commitID
git reset #commitID
Example 2: reset to commit
# rollback to commit state
git revert --no-commit 0766c053..HEAD
git commit
git reflog //to get commitID
git reset #commitID
# rollback to commit state
git revert --no-commit 0766c053..HEAD
git commit