Git 常用命令备忘

撤销操作

  • 撤销工作区修改:git checkout -- <file>
  • 撤销暂存区:git reset HEAD <file>

分支

  • 创建并切换:git checkout -b new-branch