git tips
-
modify the last commit
git commit --amend
-
modify the last 5 commit
git rebase -i HEAD~5
modify
pick
of which you want to modify toedit
and :wq to exit.git log
you can find you are at the commit which you
edit
, do as modify the last commit andgit commit --amend
back by
git rebase --continue
-
undo all the works, back to latest commit state
git reset --hard HEAD