undo git add local code example
Example 1: undo local commit
$ git reset --soft HEAD~1
Example 2: remove local branch
git branch -d branch_namegit branch -D branch_name
$ git reset --soft HEAD~1
git branch -d branch_namegit branch -D branch_name