Delete the Previous Commit in Git

This page answers questions like these:


Related Links:
Find Git Commit By Line Pattern
Revert Uncommitted Changes in Git
Change Git Commit Messages



Delete the Previous Commit in  git

git reset --hard HEAD^

Delete the Previous 2 Commits in  git

git reset --hard HEAD~2

Delete the Previous 3 Commits in  git

git reset --hard HEAD~3


Related Links:
Find Git Commit By Line Pattern
Revert Uncommitted Changes in Git
Change Git Commit Messages

Home  >  Git  >  Delete the Previous Commit in Git


Tags: git delete commit, git delete previous commit, git remove commit, git undo commit, git reverse commit, git rollback commit, git, linux, unix, solaris, bsd, aix

Copyright © HelpDoco.com
git-delete-previous-commit.txt
Git/git-delete-previous-commit.htm
3