恢复IDEA误删除的git提交,提交被删除,尝试恢复提交

​​​​​​

bash 复制代码
dgq@DESKTOP-JRQ5NMD MINGW64 /f/IdeaProjects/workspace/spzx-parent ((8bb112e...))
$ git reflog
8bb112e (HEAD, origin/master, master) HEAD@{0}: checkout: moving from master to 8bb112e5ac18dfe4bbd64adfd06363e46b609f21
8bb112e (HEAD, origin/master, master) HEAD@{1}: rebase (finish): returning to refs/heads/master
8bb112e (HEAD, origin/master, master) HEAD@{2}: rebase (start): checkout 8bb112e5ac18dfe4bbd64adfd06363e46b609f21
f422295 HEAD@{3}: commit: day11-240115-用户端后端搭建&网关&redis缓存
8bb112e (HEAD, origin/master, master) HEAD@{4}: commit: day10-订单统计&操作日志&aop
790fa87 HEAD@{5}: commit: day09-商品管理&Echarts
94c3973 HEAD@{6}: commit: day08-品牌管理&分类品牌管理&规格参数管理
2c6fe50 HEAD@{7}: commit: day07-分类管理&导入导出&品牌管理
e024dde HEAD@{8}: commit: day06-菜单管理&角色管理&动态菜单
472da13 HEAD@{9}: commit (amend): day05-文件上传删除&角色分配
c447f3a HEAD@{10}: rebase (finish): returning to refs/heads/master
c447f3a HEAD@{11}: rebase (continue): day04-角色管理&用户管理
45ea26e HEAD@{12}: rebase (start): checkout origin/master
743deb1 HEAD@{13}: commit (amend): day04-角色管理&用户管理
45ea26e HEAD@{14}: rebase (finish): returning to refs/heads/master
45ea26e HEAD@{15}: rebase (start): checkout origin/master
e7c8ab2 HEAD@{16}: commit (amend): day03-登录校验&Apifox
45ea26e HEAD@{17}: commit (amend): day03-登录校验&Apifox
57b8502 HEAD@{18}: rebase (finish): returning to refs/heads/master
:...skipping...
8bb112e (HEAD, origin/master, master) HEAD@{0}: checkout: moving from master to 8bb112e5ac18dfe4bbd64adfd06363e46b609f21
8bb112e (HEAD, origin/master, master) HEAD@{1}: rebase (finish): returning to refs/heads/master
8bb112e (HEAD, origin/master, master) HEAD@{2}: rebase (start): checkout 8bb112e5ac18dfe4bbd64adfd06363e46b609f21
f422295 HEAD@{3}: commit: day11-240115-用户端后端搭建&网关&redis缓存
8bb112e (HEAD, origin/master, master) HEAD@{4}: commit: day10-订单统计&操作日志&aop
790fa87 HEAD@{5}: commit: day09-商品管理&Echarts
94c3973 HEAD@{6}: commit: day08-品牌管理&分类品牌管理&规格参数管理
2c6fe50 HEAD@{7}: commit: day07-分类管理&导入导出&品牌管理
e024dde HEAD@{8}: commit: day06-菜单管理&角色管理&动态菜单
472da13 HEAD@{9}: commit (amend): day05-文件上传删除&角色分配
c447f3a HEAD@{10}: rebase (finish): returning to refs/heads/master
c447f3a HEAD@{11}: rebase (continue): day04-角色管理&用户管理
45ea26e HEAD@{12}: rebase (start): checkout origin/master
743deb1 HEAD@{13}: commit (amend): day04-角色管理&用户管理
45ea26e HEAD@{14}: rebase (finish): returning to refs/heads/master
45ea26e HEAD@{15}: rebase (start): checkout origin/master
e7c8ab2 HEAD@{16}: commit (amend): day03-登录校验&Apifox
45ea26e HEAD@{17}: commit (amend): day03-登录校验&Apifox
57b8502 HEAD@{18}: rebase (finish): returning to refs/heads/master
57b8502 HEAD@{19}: rebase (continue): day03-登录校验&Apifox
8385e3f HEAD@{20}: rebase (start): checkout origin/master
8a5316f HEAD@{21}: commit (amend): day03-登录校验&Apifox
9f8c7ca HEAD@{22}: rebase (abort): returning to refs/heads/master
8385e3f HEAD@{23}: rebase (start): checkout origin/master
9f8c7ca HEAD@{24}: commit (amend): day03-登录校验&Apifox
d0d6b6b HEAD@{25}: commit (amend): day03-登录校验&Apifox
e367044 HEAD@{26}: rebase (abort): returning to refs/heads/master
8385e3f HEAD@{27}: rebase (start): checkout origin/master
e367044 HEAD@{28}: commit (amend): day03-登录校验&Apifox
f9977c7 HEAD@{29}: rebase (abort): returning to refs/heads/master
8385e3f HEAD@{30}: rebase (start): checkout origin/master
:
8bb112e (HEAD, origin/master, master) HEAD@{0}: checkout: moving from master to 8bb112e5ac18dfe4bbd64adfd06363e46b609f21
8bb112e (HEAD, origin/master, master) HEAD@{1}: rebase (finish): returning to refs/heads/master
8bb112e (HEAD, origin/master, master) HEAD@{2}: rebase (start): checkout 8bb112e5ac18dfe4bbd64adfd06363e46b609f21
f422295 HEAD@{3}: commit: day11-240115-用户端后端搭建&网关&redis缓存
8bb112e (HEAD, origin/master, master) HEAD@{4}: commit: day10-订单统计&操作日志&aop
790fa87 HEAD@{5}: commit: day09-商品管理&Echarts
94c3973 HEAD@{6}: commit: day08-品牌管理&分类品牌管理&规格参数管理
2c6fe50 HEAD@{7}: commit: day07-分类管理&导入导出&品牌管理
e024dde HEAD@{8}: commit: day06-菜单管理&角色管理&动态菜单
472da13 HEAD@{9}: commit (amend): day05-文件上传删除&角色分配
c447f3a HEAD@{10}: rebase (finish): returning to refs/heads/master
c447f3a HEAD@{11}: rebase (continue): day04-角色管理&用户管理
45ea26e HEAD@{12}: rebase (start): checkout origin/master
743deb1 HEAD@{13}: commit (amend): day04-角色管理&用户管理
45ea26e HEAD@{14}: rebase (finish): returning to refs/heads/master
45ea26e HEAD@{15}: rebase (start): checkout origin/master
e7c8ab2 HEAD@{16}: commit (amend): day03-登录校验&Apifox
45ea26e HEAD@{17}: commit (amend): day03-登录校验&Apifox
57b8502 HEAD@{18}: rebase (finish): returning to refs/heads/master
57b8502 HEAD@{19}: rebase (continue): day03-登录校验&Apifox
8385e3f HEAD@{20}: rebase (start): checkout origin/master
8a5316f HEAD@{21}: commit (amend): day03-登录校验&Apifox
9f8c7ca HEAD@{22}: rebase (abort): returning to refs/heads/master
8385e3f HEAD@{23}: rebase (start): checkout origin/master
9f8c7ca HEAD@{24}: commit (amend): day03-登录校验&Apifox
d0d6b6b HEAD@{25}: commit (amend): day03-登录校验&Apifox
e367044 HEAD@{26}: rebase (abort): returning to refs/heads/master
8385e3f HEAD@{27}: rebase (start): checkout origin/master
e367044 HEAD@{28}: commit (amend): day03-登录校验&Apifox
f9977c7 HEAD@{29}: rebase (abort): returning to refs/heads/master
8385e3f HEAD@{30}: rebase (start): checkout origin/master
:
8bb112e (HEAD, origin/master, master) HEAD@{0}: checkout: moving from master to 8bb112e5ac18dfe4bbd64adfd06363e46b609f21
8bb112e (HEAD, origin/master, master) HEAD@{1}: rebase (finish): returning to refs/heads/master
8bb112e (HEAD, origin/master, master) HEAD@{2}: rebase (start): checkout 8bb112e5ac18dfe4bbd64adfd06363e46b609f21
f422295 HEAD@{3}: commit: day11-240115-用户端后端搭建&网关&redis缓存
8bb112e (HEAD, origin/master, master) HEAD@{4}: commit: day10-订单统计&操作日志&aop
790fa87 HEAD@{5}: commit: day09-商品管理&Echarts
94c3973 HEAD@{6}: commit: day08-品牌管理&分类品牌管理&规格参数管理
2c6fe50 HEAD@{7}: commit: day07-分类管理&导入导出&品牌管理
e024dde HEAD@{8}: commit: day06-菜单管理&角色管理&动态菜单
472da13 HEAD@{9}: commit (amend): day05-文件上传删除&角色分配
c447f3a HEAD@{10}: rebase (finish): returning to refs/heads/master
c447f3a HEAD@{11}: rebase (continue): day04-角色管理&用户管理
45ea26e HEAD@{12}: rebase (start): checkout origin/master
743deb1 HEAD@{13}: commit (amend): day04-角色管理&用户管理
45ea26e HEAD@{14}: rebase (finish): returning to refs/heads/master
45ea26e HEAD@{15}: rebase (start): checkout origin/master
e7c8ab2 HEAD@{16}: commit (amend): day03-登录校验&Apifox
45ea26e HEAD@{17}: commit (amend): day03-登录校验&Apifox
57b8502 HEAD@{18}: rebase (finish): returning to refs/heads/master
57b8502 HEAD@{19}: rebase (continue): day03-登录校验&Apifox
8385e3f HEAD@{20}: rebase (start): checkout origin/master
8a5316f HEAD@{21}: commit (amend): day03-登录校验&Apifox
9f8c7ca HEAD@{22}: rebase (abort): returning to refs/heads/master
8385e3f HEAD@{23}: rebase (start): checkout origin/master
9f8c7ca HEAD@{24}: commit (amend): day03-登录校验&Apifox
d0d6b6b HEAD@{25}: commit (amend): day03-登录校验&Apifox
e367044 HEAD@{26}: rebase (abort): returning to refs/heads/master
8385e3f HEAD@{27}: rebase (start): checkout origin/master
e367044 HEAD@{28}: commit (amend): day03-登录校验&Apifox
f9977c7 HEAD@{29}: rebase (abort): returning to refs/heads/master
8385e3f HEAD@{30}: rebase (start): checkout origin/master
u
dgq@DESKTOP-JRQ5NMD MINGW64 /f/IdeaProjects/workspace/spzx-parent ((8bb112e...))
$ git cherry-pick f422295
[detached HEAD 5a3d9e8] day11-240115-用户端后端搭建&网关&redis缓存
 Date: Tue Mar 5 21:23:26 2024 +0800
 33 files changed, 692 insertions(+), 6 deletions(-)
 create mode 100644 spzx-common/common-service/src/main/java/com/atguigu/spzx/common/handler/config/RedisConfig.java
 create mode 100644 spzx-model/src/main/java/com/atguigu/spzx/model/dto/h5/ProductSkuSearchDto.java
 create mode 100644 spzx-model/src/main/java/com/atguigu/spzx/model/vo/h5/IndexVo.java
 create mode 100644 spzx-server-gateway/pom.xml
 create mode 100644 spzx-server-gateway/src/main/java/com/atguigu/spzx/gateway/SpzxGatewayApplication.java
 create mode 100644 spzx-server-gateway/src/main/java/com/atguigu/spzx/gateway/config/SpzxGatewayConfig.java
 create mode 100644 spzx-server-gateway/src/main/resources/application-dev.yml
 create mode 100644 spzx-server-gateway/src/main/resources/application.yml
 create mode 100644 spzx-service/pom.xml
 create mode 100644 spzx-service/service-product/pom.xml
 create mode 100644 spzx-service/service-product/src/main/java/com/atguigu/spzx/product/SpzxProductApplication.java
 create mode 100644 spzx-service/service-product/src/main/java/com/atguigu/spzx/product/controller/CategoryController.java
 create mode 100644 spzx-service/service-product/src/main/java/com/atguigu/spzx/product/controller/IndexController.java
 create mode 100644 spzx-service/service-product/src/main/java/com/atguigu/spzx/product/controller/ProductController.java
 create mode 100644 spzx-service/service-product/src/main/java/com/atguigu/spzx/product/mapper/CategoryMapper.java
 create mode 100644 spzx-service/service-product/src/main/java/com/atguigu/spzx/product/mapper/ProductSkuMapper.java
 create mode 100644 spzx-service/service-product/src/main/java/com/atguigu/spzx/product/service/CategoryService.java
 create mode 100644 spzx-service/service-product/src/main/java/com/atguigu/spzx/product/service/IndexService.java
 create mode 100644 spzx-service/service-product/src/main/java/com/atguigu/spzx/product/service/ProductSkuService.java
 create mode 100644 spzx-service/service-product/src/main/java/com/atguigu/spzx/product/service/impl/CategoryServiceImpl.java
 create mode 100644 spzx-service/service-product/src/main/java/com/atguigu/spzx/product/service/impl/IndexServiceImpl.java
 create mode 100644 spzx-service/service-product/src/main/java/com/atguigu/spzx/product/service/impl/ProductSkuServiceImpl.java
 create mode 100644 spzx-service/service-product/src/main/resources/application-dev.yml
 create mode 100644 spzx-service/service-product/src/main/resources/application.yml
 create mode 100644 spzx-service/service-product/src/main/resources/mapper/ProductSkuMapper.xml

dgq@DESKTOP-JRQ5NMD MINGW64 /f/IdeaProjects/workspace/spzx-parent ((5a3d9e8...))
$
  1. 使用 Git Reflog

    在项目文件夹中打开命令行,然后输入 git reflog 命令。这个命令会显示你的 Git 引用日志,包括你执行过的所有 Git 命令,尤其是那些更改了 HEAD 的命令。在输出中找到你误删提交的哈希值。

  2. 恢复提交

    如果你找到了误删提交的哈希值,你可以使用 git cherry-pick <commit-hash> 命令来恢复这个提交。将 <commit-hash> 替换为你找到的提交哈希值。

相关推荐
CoderJia程序员甲5 小时前
重学SpringBoot3-整合 Elasticsearch 8.x (三)使用Repository
java·大数据·spring boot·elasticsearch
东方巴黎~Sunsiny5 小时前
如何优化Elasticsearch的查询性能?
大数据·elasticsearch·搜索引擎
计算机软件程序设计6 小时前
如何使用IDEA创建Maven/SSM工程?
java·maven·intellij-idea·ssm
NoneCoder11 小时前
命令行工具进阶指南
大数据·elasticsearch·搜索引擎
YoungHong199211 小时前
Git删除本地已经merge到远程的分支
git
许苑向上12 小时前
【Elasticsearch】Elasticsearch集成Spring Boot
spring boot·elasticsearch·jenkins
内核程序员kevin16 小时前
GitHub新手入门 - 从创建仓库到协作管理
git·github
东方巴黎~Sunsiny17 小时前
Elasticsearch中什么是倒排索引?
大数据·elasticsearch·jenkins
任聪聪17 小时前
【JAVA基础】MAVEN的安装及idea的引用说明
java·maven·intellij-idea
开拓忍者18 小时前
关于 npm 更新镜像源问题
spring boot·intellij-idea