Text only
Git revert to previous commit
/raw/31a8fbd4a05e38940ca39a079524ee64/
31a8fbd4a05e38940ca39a079524ee64
text
Text only
5
2025-04-03T18:49:38
True
False
False
Sep 24, 2021 at 01:16 PM
/api/public/snipt/118/
git-revert-to-previous-commit
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a>
<a href="#L-2">2</a>
<a href="#L-3">3</a>
<a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a># Check the log to get the hash
</span><span id="L-2"><a name="L-2"></a>git log --oneline
</span><span id="L-3"><a name="L-3"></a>
</span><span id="L-4"><a name="L-4"></a>git reset --hard <hash>
</span></pre></div>
</td></tr></table>