Undo Git Commit and Commit again

Words
40
Reading
1 min
Listen
Play
7y

a29gsi.png

If you accidentally commit locally, for example:
git commit -m "Fix AppSettings"

You could always go back by moving head.
This command will undo commit and unstage all files.
git reset --soft HEAD~

You could edit files, add only add those which you prefer to commit:
git add .

git commit -m "Fix AppSettings" or use variable git commit -c ORIG_HEAD

Undo Git Commit and Commit again | Ecency