In this article let’s discuss about Git undo last commit. Let’s go through the following methods without any delay.
# KEEP CHANGES git reset --soft HEAD~1 # REMOVE CHANGES git reset --hard HEAD~1
If you are facing any issues with the above approach then try the alternative that is given below. It may look similar by have a try!
Method 2 :
# Uncommit the changes git reset --soft HEAD~1 # Completely delete the changes git reset --hard HEAD~1
Hope the above solution works.
Realted Posts : How do i get the last commit