Answers for "how to revert most recent commit in git"

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 get back to most recent commit

# Go to latest commit of a branch
git checkout branchname
# You can also do to switch back to wherever it was before the last checkout. 
git checkout -
Posted by: Guest on April-22-2022

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language