Answers for "bootsrap href"

8

how to uncommit my last commit in git

git reset --soft HEAD^

git reset HEAD^
//And if you actually want to completely undo it, throwing away all uncommitted changes, resetting everything to the previous commit (as the original question asked):

git reset --hard HEAD^
Posted by: Guest on March-18-2020
7

undo local commit

$ git reset --soft HEAD~1
Posted by: Guest on April-09-2020
1

revert last commit

git reset HEAD~
Posted by: Guest on August-13-2020
1

undo last commit

$ git reset --hard HEAD~1
Posted by: Guest on July-12-2020
2

undo most recent commit

$ git commit -m "some comment"                
$ git reset HEAD~                                          
<< edit files as necessary >>                              
$ git add ...                                              
$ git commit -c ORIG_HEAD
Posted by: Guest on June-18-2020
0

git delete commit

git reset --hard <last_working_commit_id>
Posted by: Guest on April-30-2021

Browse Popular Code Answers by Language