how reset commit git with losing changes code example
Example 1: reset last commit without losing changes
git reset HEAD~1 --soft
Example 2: how reset commit git with losing changes
git reset HEAD~1 --soft
git reset HEAD~1 --soft
git reset HEAD~1 --soft