Discuss / Git / 打卡

打卡

Topic source

XERIN24040

#1 Created at ... [Delete] [Delete and Lock User]

1.没有git add时,用git checkout -- file

2.已经git add时,先git reset HEAD <file>回退到1.,再按1.操作

3.已经git commit时,用git reset回退版本

4.推送到远程库,GG?

XERIN24040

#2 Created at ... [Delete] [Delete and Lock User]

git checkout是回退到并与版本库最新版本一致

git reset HEAD <file>是回退到与上一次暂存区一致

XERIN24040

#3 Created at ... [Delete] [Delete and Lock User]

不对,他们两个都是回退到与版本库最新版本一致,只不过git checkout是工作区回退,git reset HEAD <file>是暂存区回退,嗯


  • 1

Reply