Published: 17 Feb 2020 › Updated: 17 Feb 2020
Undo Git Commit and Commit again
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:
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
- Developers: how much memory do you need?
- Big Sur is out!!! First Impressions?
- Nuckindosh
- SSH/SFTP Authentication with SSH Private Key
- How to Dockerize Sample .NET Core API/Web Application
- How to Install GitVersion on Mac OS X
- How to Install Git Flow on Mac OS X
- Export non-exportable Certificate in Microsoft Windows
- GPS Clock v0.1 - Simple Prototype
- Disable Viber Ads for Mac OS X / Linux
- Undo Git Commit and Commit again