Rasa Govinda das avatar

Undo Git Commit and Commit again

tomas-petrauskas

Published: 17 Feb 2020 › Updated: 17 Feb 2020Undo Git Commit and Commit again

Undo Git Commit and Commit again

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

Leave Undo Git Commit and Commit again to:

Written by

(Tomas Petrauskas)

Read more #commit posts


Best Posts From Rasa Govinda das

We have not curated any of tomas-petrauskas's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From Rasa Govinda das