git undo comit code example
Example 1: how to undo init git
rm -rf .git
Example 2: undo local commit
$ git reset --soft HEAD~1
Example 3: git undo add
// undo add for one file
git reset <file>
// undo add for all files
git reset
Example 4: revert last commit
$ git reset --soft HEAD~1