git checkout
git checkout用于切换分支、撤销修改或恢复文件
-
切换分支
git checkout my_branch -
创建分支并切换到新分支
git checkout -b new_branch -
恢复文件到最新提交版本
git checkout my_file等同于git restore -
撤销本地修改
git checkout -fforce checkout (throw away local modifications)
ChatGPT对话:https://poe.com/s/w9qVjGiUPJNWFQpWZhdY

浙公网安备 33010602011771号