一、未使用 git add 缓存代码时。
git checkout .
二、使用了 git add 缓存了代码。
git reset HEAD .
三、使用了 git commit
git reset --hard HEAD^ 强制回到commit之前
四、删除本地分支
git branch -d 分支名字
五、删除远程分支
git push origin --delete 分支名字
六、本地暂存代码
git stash
七、读取暂存
git stash pop
八、查看分支
git branch
九、命令行 合并冲突 commit 注释
: --> wq
十、版本回退
git log
git reset --hard 版本号
使用“git push -f”提交更改:
十一、取消当前merge合并
git merge --abort
十二、commit 不进行校验
git commit -m “fix[测试]:不校验” --no-verify