Git 命令总结

1.还原某个文件到指定版本

// 查看filename在git上的历史版本
git log <filename>

// 回退文件到commit版本
git checkout <commit version> <filename>

// 编写备注,提交代码
git commit -m "comments"

// 直接将本地分支提交到远端分支上
git push origin <local branch>:<remote branch>

2.git上传打文件失败报http 413错误解决办法

https://www.jianshu.com/p/5f29afdf8594

3.当本地代码混乱时,想重新拉取服务器上的代码

git fetch --all
git reset --hard origin/master
git pull

 

posted @ 2021-08-24 13:28  一个小bu⑥  阅读(17)  评论(0编辑  收藏  举报