git : 使用reset回退版本后找不到最新版本的解决办法

git fsck --lost-found 命令,找出当前被丢弃的提交

E:\BSgitlab\ds-address>git fsck --lost-found
Checking object directories: 100% (256/256), done.
Checking objects: 100% (4/4), done. 
dangling commit 410087eebc7dda0aa79d0f55fcb1fef1e3f4f289
dangling blob 576078d77af4b5a7ecce4ba4e133d7b6703f2a3c
dangling blob 7060694edd0ab3da4ce6bb57fcdbc6f2e9608df6
dangling blob 9740013d879552bdd4effe4fe9ff11e9180e83a7
dangling blob 26a10fb5bb89abf135760df780de74aff6d98b69
dangling blob 5ea15e0f420abd1267a0b4ec8793bbf295c62ff5
dangling blob 6be132bad6c7940b10015c59e4e4e81b222860f9
dangling blob ac018dddd9ae61b646f7e7e3028f33b95c7f06c0
dangling blob 0a82a2fe0b09d7a68b7d74a897e8b9d0cbb29949
dangling commit 8f62c5c1dbdf5f2ba4377c89de590a552f80d6d9

git show <commit id> 显示提交的具体信息

E:\BSgitlab\ds-address>git show 0dbd6c22c112deefebd5b62767b9bd4bb7663415
commit 0dbd6c22c112deefebd5b62767b9bd4bb7663415
Author: test <test@test.com.cn>
Date:   Thu Jun 28 18:00:20 2018 +0800

    <E4><B8><B4><E6><97><B6>

diff --git a/ds-match-server/application.properties b/ds-match-server/application.properties
index ff8ace2..2bb5b43 100644
--- a/ds-match-server/application.properties
+++ b/ds-match-server/application.properties
@@ -15,9 +15,9 @@ server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %F %I

git reset --hard <commit id> 回滚到指定的提交

E:\BSgitlab\ds-address>git reset --hard 0dbd6c22c112deefebd5b62767b9bd4bb7663415
HEAD is now at 0dbd6c2 临时

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值