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

Comments

Post a Comment

Popular posts from this blog

How to SSH to remote server without entering password each time.

How to redirect a URL in NGINX

Ruby on Rails Installation on Windows 7