git log
查看我们修改过的历史记录
![image](https://cloud.githubusercontent.com/assets/17243165/15448659/a9cfb052-1f9a-11e6-8564-c1f7d960fa14.png)
git reset --hard commit id
这是回退到某个版本,commit id号可以只是截取开始的一部分
![image](https://cloud.githubusercontent.com/assets/17243165/15448681/f8c2102e-1f9a-11e6-86a2-0e84cd75510b.png)
dir
查看文件夹目录里面的所有文件
cat
打印某个文件
![image](https://cloud.githubusercontent.com/assets/17243165/15448689/41ce494a-1f9b-11e6-9b67-6d709e492d85.png)
git reflog
查看记录你执行过的每一次命令
![image](https://cloud.githubusercontent.com/assets/17243165/15448814/e7b0beb2-1f9e-11e6-914b-fb18afb76dc1.png)
git checkout
切换到某个分支
![image](https://cloud.githubusercontent.com/assets/17243165/15448702/b1787d56-1f9b-11e6-8ffc-5dd1102d7554.png)
git status
push前看看修改过了什么文件
![image](https://cloud.githubusercontent.com/assets/17243165/15448704/c37566c2-1f9b-11e6-9481-512800fc3955.png)
git branch -d xxxx
删除本地分支,注意在当前这个分支不能删除自己,只能切换到其他分支再删除当前的这个分支
![image](https://cloud.githubusercontent.com/assets/17243165/15448710/f3f80f3e-1f9b-11e6-8044-434fecc81810.png)
git branch -a
查看本地和远程分支
![image](https://cloud.githubusercontent.com/assets/17243165/15448737/7e299984-1f9c-11e6-96e4-e8a3bbbbd54c.png)
git merge xxx
合并xxx分支到当前分支
![image](https://cloud.githubusercontent.com/assets/17243165/15448802/b435b40c-1f9e-11e6-9b58-c417ead4b55d.png)
git add [<file>]
添加文件到缓存区,也可以 "git add ." 添加所有文件到缓存
![image](https://camo.githubusercontent.com/0578c856bb12c2d10df176e47f59cbd2af43e4ff602bb05cbbc76116b6cd433a/687474703a2f2f696d672e626c6f672e6373646e2e6e65742f3230313630363031313733353032393037)
git diff [<file>]
比较当前文件和暂存区文件差异
![image](https://camo.githubusercontent.com/51156386e08e0e4ec88ae76d94318bcf978be86d0f9a29ded2c146229e24785e/687474703a2f2f696d672e626c6f672e6373646e2e6e65742f3230313630363032313034373134303536)
git checkout [<file>]
回滚指定文件
![image](https://cloud.githubusercontent.com/assets/17243165/15766871/b602ea8a-2975-11e6-81d7-e9212f01b041.png)