[Git] Use and Compare the Different git Reset Options: --hard, --soft, and --mixed
Git -- The and use reset Options different
2023-09-14 08:59:14 时间
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
相关文章
- 如何搭建一台属于自己的Git服务器?
- git 那些事儿 —— 基于 Learn Git Branching
- git clone时出现的两种报错及解决办法[通俗易懂]
- git clone 出错
- Git Message 编写规范
- Git安装与常用命令和分支操作 码云配置 笔记
- 加速几十倍 git clone 速度的 --depth 1,它的后遗症怎么解决?
- Git命令——学习笔记2
- 【Git】Git 分支管理 ( 创建并切换分支 git switch -c dev | 切换分支 git switch dev )
- 【错误记录】Git 使用报错 ( git branch -a 仍能查询到已经删除的远程分支 )
- 【Git】Git 分支管理 ( 使用 git cherry-pick 命令提取提交记录应用于当前分支 | 创建新分支应用某个提交 | git cherry-pick 冲突处理 )
- 【Git】Git 标签使用 ( 查询哈希码 | 创建标签 git tag v1.0 | 查询标签 git tag | 查询标签信息 git show v1.0 | 创建标签并指定说明 | 删除标签 )
- 我是如何做到的:不切换 Git 分支,同时在多个分支上工作的?
- Git 2.40 发布,包括 git jump 工具的更新、cat-file 工具的增强以及提高 Windows 上响应速度
- Git和SVN之间的几个基本区别详解架构师
- Linux环境下安装Git步骤指南(linux安装git)
- Git与Linux结合:创造无限可能(git和linux)
- Git 介绍与使用详解
- 如何在Linux上轻松部署Git?(linux下部署git)
- Linux下安装Git的指引(在linux下安装git)