There are two ways to reset your GIT commits

1. Soft reset
2. Hard reset

A soft reset will reset your last commit to its previous commit and you won’t lose your changes.
A Hard reset will reset your last commit to its previous commit but you will lose your changes

SOFT RESET

git reset --soft HEAD~1
// This will reset your last commit its previous commit
// You wont lose changes
// Run git status, to list out your files
git status

HARD RESET

git reset --hard HEAD~1

// This will reset your last commit to its previous commit
// and you will lose all of your changes

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *