From cafb099c4000cc04263b509ea0ee3c9cdc1f0ad7 Mon Sep 17 00:00:00 2001 From: yovinchen Date: Thu, 25 Jan 2024 14:52:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=AE=8C=E6=88=90=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E6=AD=A3=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ba830d..408d88c 100644 --- a/README.md +++ b/README.md @@ -230,6 +230,31 @@ services: start_period: 60s #⾸次检测延迟时间 ``` -学习 git 提交回滚 +## 学习 git 提交回滚 +```shell 撤销提交重新推送 + +重新提交推送 + +再次尝试提交推送 +``` + +总结:自己的远程分支版本回退的方法 + +```shell +#首先找到需要会退版本ID +git reflog + +#如果你的错误提交已经推送到自己的远程分支了,那么就需要回滚远程分支了。 +#首先要回退本地分支 +git reflogç +git reset --hard Obfafd + +#紧接着强制推送到远程分支 +git push -f +``` + +最后强制推送效果(可视化中没有找到强制推送,先使用命令行强制推送吧) + +![image-20240125145054441](https://lsky.hhdxw.top/imghub/2024/01/image-202401251706165455.png)