Posts

Showing posts with the label Cancel GIT Commit

How to cancel a local GIT commit?

If you want to retain the changed content of the file and  cancel the last commit use:    git reset HEAD^ or git reset HEAD~1   ( both are same) If you dont want to retain the content of the changed file use: git reset --hard HEAD~1