Change history
If this is the last commit, you can simply do this:
git commit
This calls the editor with the last commit message and allows you to edit the message. (You can use -m
if you want to erase the old message and use the new one.)
Pressing
, , :
git push --force-with-lease <repository> <branch>
"+":
git push <repository> +<branch>
--force
:
git push --force <repository> <branch>
.
- , , , . --force-with-lease
, , - (
, Git push . "", .
/
, , , ( , ), - :
git fetch origin
git reset --hard origin/master
reset --hard
. , .
, --force
. --force
" , , ". , reflog - , ( ).
, , --force
... .
--force-with-lease
.