how to undo last commit in git before push code example Example: undo last commit pushed git reset # commitId # Exemple git reset 5310517