There are certain scenarios where you need to unstage local Git commit changes. As everything with Git, there are multiple angles from which you can approach almost anything.
Unstage commit but keep changes
git reset --soft HEAD
Unstage commit and get rid of any changes
git reset --hard HEAD
HEAD means that you will unstage your last commit. If that’s not the case, replace
HEAD with the preferred commit ID.
Related post: Unstaging files in Git.
To find more neat Git commands and hacks, simply browse the Git category. Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.