gpt4 book ai didi

git - 撤销 git push 到分支 master

转载 作者:行者123 更新时间:2023-12-04 02:11:16 27 4
gpt4 key购买 nike

我犯了一个错误,我在分支开发上工作,但我对分支主机进行了 git 推送。我怎样才能撤消它?谢谢!

git push origin c45f349cedfc1df51300a8ebb964088c305f2567:master
WARNING

Any access or any attempt to access this machine without permission is forbidden
and could be subject to criminal and civil penalties.

To protect this system from unauthorised use, viruses and to ensure that the
system is functioning properly, security systems have been installed.

Any unauthorised attempt to stop or bypass one of these security tools is
forbidden.

ATTENTION

Tout acces ou tentative d'acces non autorisee sur ce systeme est interdit
et sujet a des poursuites penales ou civiles.

Pour proteger ce systeme des acces frauduleux et des virus, et pour assurer son
bon fonctionnement, des systemes de securites ont ete installes.

Toute tentative non autorisee pour arreter ou contourner l'un de ces
dispositifs est interdite.
Counting objects: 10, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (10/10), 1.78 KiB | 0 bytes/s, done.
Total 10 (delta 7), reused 0 (delta 0)
To git@git.oad.exch.int:optiq/message-bus.git
0ca786a..c45f349 c45f349cedfc1df51300a8ebb964088c305f2567 -> master

最佳答案

  1. checkout 掌握

git checkout master

  1. 查看master最后一次提交

git log --oneline

  1. 重置为上次提交

git reset --hard lastcommit

  1. 强制推送 origin master

git push -f origin master:master

关于git - 撤销 git push 到分支 master,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38100888/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com