git reset --hard HEAD~1
git push -f <remote> <branch>
(Example push: git push -f origin bugfix/bug123
)
This will undo the last commit and push the updated history to the remote. You need to pass the -f
because you're replacing upstream history in the remote.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…