参考:
https://git-scm.com/book/zh/v1/Git-%E5%88%86%E6%94%AF
http://www.ruanyifeng.com/blog/2014/06/git_remote.html
1.回退 (将某个文件回退到Git最后的版本)
git checkout HEAD fileName
2.切换分支
git checkout branchName
3.git pull命令的作用是,取回远程主机某个分支的更新,再与本地的指定分支合并
git pull <远程主机名> <远程分支名>:<本地分支名>
git checkout -b newBranch
5.合并分支
git merge otherBranch
6.删除分支
git branch -d branchName
7.撤销提交
git log
git reset --hard commit_id
8.问题:超前一个版本,落后一个版本
$ git reset --hard HEAD 该命令撤销最近一次提交,回到push之前的状态,但所有commit的内容都会消失,会丢失本次修改的代码。
$ git reset --soft HEAD 该命令可以保证你提交的代码原封不动的保存下来