git 常用操作

vs、vscode远程分支显示不全问题(缓存问题)

git remote update origin --prune

git提交回退

git reset --hard:重置stage区和工作目录(缓存区)

git reset --hard  commitID        

git reset --soft:保留工作目录,并把重置 HEAD 所带来的新的差异放进暂存区

git reset --soft  commitID        

提交到到去服务器后可以这么回退

git reset --hard  commitID 
git push -f origin  版本号
原文地址:https://www.cnblogs.com/YorkQi/p/14536345.html