Way 1
1. Find your committed hash by :
git log
2. After found your commit hash you need revert it by :
git revert <commit-hash>
3. choose one at bellow with responsibility:
βΈ»
π’ Uncommit last commit (keep files):
git reset --soft HEAD~1
β Files stay staged, just remove commit.
βΈ»
π‘ Uncommit & Unstage (keep changes in working directory):
git reset --mixed HEAD~1
β Files stay, but unstaged (not in commit).
βΈ»
π΄ Uncommit & Remove changes:
git reset --hard HEAD~1
β οΈ Files & commit both gone! Careful!
βΈ»
π£ Uncommit pushed commit (force push):
git reset --soft HEAD~1
git push --force
β Removes commit on remote branch too.
βΈ»
Top comments (0)