## delete file
有三种情况
add before
rm rf fileName
复制代码
add after and commit before
git rm --cached <file> #remove from cache,file will be untracked
git rm -f <file> #delete file forced
复制代码
second add and commit before
git reset HEAD <file> #remove from cache,file will be untracked
复制代码
commit after
rm -rf c.txt
#delete file
git add c.txt #git rm c.txt
git commit -m "delete file"
#or discard changes in the
git checkout -- c.txt
复制代码
git commit time metaphor
The HEAD pointer is the reference to the last commit we did or the parent of the next commit we will do.So,the HEAD pointer is the road sign that indicates the way to move one step back to the past.
git reset --hard HEAD # go back the last commit,
#在我们commit后修改了文件,可以回退到上一次版本
复制代码