[Git] Use and Compare the Different git Reset Options: --hard, --soft, and --mixed
Git -- The and use reset Options different
2023-09-14 09:00:48 时间
git reset
has three primary options that we might use: --soft
, --hard
and --mixed
(the default).
We'll use git reset
to undo the latest commit in all three ways, and compare the result of reseting with each flag.
git reset --soft HEAD~1 // keep staging but remove commit git reset --mixed HEAD~1 // remove staging and commit, but keep the changes git reset --hard HEAD~1 // remove the changes, commit, and staging
相关文章
- jenkins+git+maven搭建自动化部署项目环境
- CentOS 6.8 搭建 Git 代码托管系统 Gitea
- git修改远端服务器地址
- 搭建自己的GIT环境
- 【转载】GIT 使用时遇到的行结束符设置问题
- [Git] Use git add --patch for better commit history and mitigating bugs
- [Git] Stashing -- Ex
- Windows下Git多账号配置,同一电脑多个ssh-key的管理
- IDEA 中如何完成Git 和SVN 版本控制的切换
- 关于git的理解2
- 每日一条 git 命令行:git clone https://xxxxx.git -b 12.0 --depth 1
- git restore指令和git restore --staged 的使用
- 使用dockerfile克隆私有git仓库
- 使用git config --global设置用户名和邮件
- GIT学习----第七节:删除文件
- 完美解决 fatal: Not a git repository (or any of the parent directories): .git
- git报错:error.GitError: manifests rev-list (‘^HEAD‘, ‘14686468c69c63f1995ab2a0a9ad90b2e1d5e01c‘, ‘--‘)