How do you undo the last local commit without removing the changes?
a)
git reset --soft HEAD^b)
git revert HEAD^c)
git reset --hard HEAD^d)
git checkout --lastAnswer:
a)
git reset --soft HEAD^Explanation:
The git reset --soft HEAD^ command undoes the last commit while keeping the changes in the staging area. This allows you to modify the commit or make additional changes before committing again.
For example, running this command moves the HEAD pointer back to the previous commit but leaves all changes intact.
This is useful when you want to amend or adjust your last commit without losing any work.