git 入门

git 撤销操作 git reset HEAD^ 撤销上一次commit

git restore <文件> 把暂存区的内容撤出

git log –graph

git log file

git rm -f file 可以把工作区的也一起删除

git rm –cached -r example/ 不再追踪example/目录下的所有内容,然后再commit 工作区里面的文件不会被删除

git checkout hash filename 先通过 git log 查看commit的hash值 ,再恢复到对应的版本。对应版本覆盖最新的版本

git diff HEAD file,可以查看工作区的file与仓库中file的差异

git stash

git stash show

git stash list

git stash save “comments”

git stash pop

发表评论

您的电子邮箱地址不会被公开。 必填项已用 * 标注