From 5f66891b8b17c3ce79d07aa9a91af8f8a525fa52 Mon Sep 17 00:00:00 2001 From: yovinchen Date: Thu, 25 Jan 2024 14:39:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=AD=A6=E4=B9=A0=20git=20=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b17e1fe..0016836 100644 --- a/README.md +++ b/README.md @@ -229,3 +229,5 @@ services: retries: 3 start_period: 60s #⾸次检测延迟时间 ``` + +学习 git 提交回滚 -- 2.40.1 From cbc0eea5e743777db960fcc4342be49280f3dd8d Mon Sep 17 00:00:00 2001 From: yovinchen Date: Thu, 25 Jan 2024 14:41:59 +0800 Subject: [PATCH 2/3] =?UTF-8?q?Reapply=20"=E6=92=A4=E9=94=80=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E9=87=8D=E6=96=B0=E6=8E=A8=E9=80=81"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 64b65acefff9607d2b9a670db18677ece0111eec. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b17e1fe..ea2613a 100644 --- a/README.md +++ b/README.md @@ -229,3 +229,5 @@ services: retries: 3 start_period: 60s #⾸次检测延迟时间 ``` + +撤销提交重新推送 -- 2.40.1 From cafb099c4000cc04263b509ea0ee3c9cdc1f0ad7 Mon Sep 17 00:00:00 2001 From: yovinchen Date: Thu, 25 Jan 2024 14:52:32 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=9B=9E=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) -- 2.40.1