git指令
拉取指定版本的git分支
bash
git clone -b 版本号
查看分支
bash
git branch
# 该指令会查看当前所有分支,当前分支前面会有星号
切换分支
bash
git checkout <branch_name>
版本回溯
bash
git reset
# 重置到当前分支的最新提交,不改变暂存区和工作区
bash
git reset --soft <commit> # 重置到指定的 <commit>,会将该提交之后的更改保留在暂存区,不会影响工作区
git reset --mixed <commit> # 重置暂存区,保留工作区
git reset --hard <commit> # 重置暂存区和工作区