git add to last commit when already pushed code example
Example 1: cancel a commit not pushed
git reset --soft HEAD~
Example 2: undo last commit pushed
git reset # commitId
# Exemple
git reset 5310517
git reset --soft HEAD~
git reset # commitId
# Exemple
git reset 5310517