Friday 3 June 2022

GIT ammend commit msg && revert commit (not pushed)

ammend last commit msg :

git commit --amend

https://www.atlassian.com/git/tutorials/rewriting-history 


https://www.theserverside.com/tutorial/How-to-git-revert-a-commit-A-simple-undo-changes-example



$ git reflog
(HEAD -> master)
d846aa8 HEAD@{0}: commit: 5th git commit: 5 files
0c59891 HEAD@{1}: commit: 4th git commit: 4 files
4945db2 HEAD@{2}: commit: 3rd git commit: 3 files
defc4eb HEAD@{3}: commit: 2nd git commit: 2 files
2938ee3 HEAD@{4}: commit: 1st git commit: 1 file
$ git revert 4945db2

No comments:

Post a Comment