<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>撤销 on kenji.blog</title><link>http://kenji.blog/zh-cn/tags/%E6%92%A4%E9%94%80/</link><description>Recent content in 撤销 on kenji.blog</description><generator>Hugo -- gohugo.io</generator><language>zh-cn</language><copyright>kenjinote</copyright><lastBuildDate>Wed, 15 May 2024 23:32:43 +0900</lastBuildDate><atom:link href="http://kenji.blog/zh-cn/tags/%E6%92%A4%E9%94%80/index.xml" rel="self" type="application/rss+xml"/><item><title>撤销git reset的方法</title><link>http://kenji.blog/zh-cn/p/git-reset%E3%82%92%E5%8F%96%E3%82%8A%E6%B6%88%E3%81%99%E6%96%B9%E6%B3%95/</link><pubDate>Wed, 15 May 2024 23:32:43 +0900</pubDate><guid>http://kenji.blog/zh-cn/p/git-reset%E3%82%92%E5%8F%96%E3%82%8A%E6%B6%88%E3%81%99%E6%96%B9%E6%B3%95/</guid><description>&lt;img src="http://kenji.blog/p/git-reset%E3%82%92%E5%8F%96%E3%82%8A%E6%B6%88%E3%81%99%E6%96%B9%E6%B3%95/img.png" alt="Featured image of post 撤销git reset的方法" />&lt;h1 id="撤销git-reset的方法">撤销git reset的方法
&lt;/h1>&lt;p>在执行 git commit 之后，如果不小心执行了 git reset，这里介绍撤销 git reset 的方法（即恢复到 git commit 时状态的方法）。&lt;/p>
&lt;ol>
&lt;li>使用 &lt;code>git reflog&lt;/code> 确认重置前的提交 ID&lt;/li>
&lt;li>使用 &lt;code>git reset --hard HEAD@{数字}&lt;/code> 恢复到重置前的状态&lt;/li>
&lt;/ol>
&lt;p>以上就是撤销 git reset 的方法。&lt;/p></description></item></channel></rss>