git 代码回滚至指定commit,怎么退出git log,怎么提交回滚的代码

需要在记录中查找到 commit_id

git 复制代码
git log   // 按q键退出查询状态

git命令进行回滚

git 复制代码
git reset --hard  <需要回滚的commitId>

将回滚的代码提交

git 复制代码
git push -f origin <当前分支名>
相关推荐
vistaup20 小时前
windows git 更新当前目录下所有的文件(非递归)
windows·git
王码码203521 小时前
Flutter for OpenHarmony:Flutter 三方库 algoliasearch 毫秒级云端搜索体验(云原生搜索引擎)
android·前端·git·flutter·搜索引擎·云原生·harmonyos
Irene19911 天前
Git 命令汇总表(基于一次完整的 Git 实战经验整理,涵盖从安装配置到日常开发、问题排查的所有常用命令)
git·常用命令
q5431470871 天前
Redis Desktop Manager(Redis可视化工具)安装及使用详细教程
redis·git·bootstrap
素雨迁喜1 天前
Linux平台下git工具的使用
linux·运维·git
Irene19911 天前
Windows环境,VS Code 中 Git 配置指南
git·基础配置
Yang-Never1 天前
AI Code -> Windows电脑安装Claude
开发语言·windows·git
Irene19911 天前
2026 前端开发 Windows 安装 Git 配置指南(有实际安装过程参考:适配版本 the latest 2.53.0(2) x64 )
前端·windows·git
早起的年轻人1 天前
告别Git仓库臃肿:一招解决Maven target目录误提交问题
java·git·maven
悠然大月季2 天前
git 怎么导出提交历史,文件是乱码
git·git导出历史记录·git导出历史乱码