Answers for "git reset commit"

48

undo commit

# KEEP CHANGES
git reset --soft HEAD~1

# REMOVE CHANGES
git reset --hard HEAD~1
Posted by: Guest on April-07-2020
15

git undo commit

# Uncommit the changes
git reset --soft HEAD~1

# Completely delete the changes
git reset --hard HEAD~1
Posted by: Guest on September-04-2020
18

git cancel last commit

git reset --soft HEAD~1
Posted by: Guest on March-30-2020
4

git reset to commit

# reset to specefic commit
git reset --hard <commit id>

# to go back one step 
git reset --hard HEAD~1

# note: use --soft to keep file changes
Posted by: Guest on March-05-2021
6

git soft reset head

git reset --soft HEAD^
//resets head by 1
Posted by: Guest on August-13-2020
3

undo last commit

#this  will preserve changes done to your files
git reset --soft HEAD~1

#this will get rid of the commit and the changes done to the files
$ git reset --hard HEAD~1
Posted by: Guest on December-16-2020

Browse Popular Code Answers by Language