2
回答
用GIT时,WINDOWS里坑爹的CMD,BASH就OK
利用AWS快速构建适用于生产的无服务器应用程序,免费试用12个月>>>   

其中一个BUG

git reset --hard HEAD^

恢复到上一提交时

git reset --hard HEAD^



git init
Initialized empty Git repository in D:/scm/git/.git/

echo 1 >1

git add .

git commit -m "init"
[master (root-commit) 92540cb] init
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 1
==================
echo 2 >2

git add .

git commit -m "2"
[master 6f88a5a] 2
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 2
===================
echo 3 >3

git add .

git commit -m "3"
[master ba5829c] 3
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 3
==================
git log
commit ba5829ccbb818535087200dcf26832827cecdc26
Author: ddatsh <ddatsh@gmail.com>
Date:   Wed Sep 28 16:23:54 2011 +0800

    3

commit 6f88a5ae7d30d78cd29acff26ea8671adbb829d0
Author: ddatsh <ddatsh@gmail.com>
Date:   Wed Sep 28 16:23:42 2011 +0800

    2

commit 92540cb83f82b8867f704ae4afdab65d281dc111
Author: ddatsh <ddatsh@gmail.com>
Date:   Wed Sep 28 16:23:33 2011 +0800

    init
=====================
git reset --hard HEAD^
回车后屏幕出现
More?
More?
两次回车后
HEAD is now at ba5829c 3
无法恢复到上一提交

而在bash中就行

Git
举报
ddatsh
发帖于6年前 2回/4K+阅
顶部