{"absolute_url": "/jbmckee/git-revert-to-previous-commit/", "blog_post": false, "code": "# Check the log to get the hash\ngit log --oneline\n\ngit reset --hard <hash>\n", "created": "2021-09-24T13:16:45.957497", "description": "", "description_rendered": "", "embed_url": "https://snipt.net/embed/31a8fbd4a05e38940ca39a079524ee64/", "full_absolute_url": "/jbmckee/git-revert-to-previous-commit/", "id": 118, "lexer": "text", "line_count": 5, "log_entries": [{"code": "# Check the log to get the hash\ngit log --oneline\n\ngit reset --hard <hash>\n", "created": "2021-09-24T13:16:46.020266", "diff": "--- \n+++ \n@@ -0,0 +1,4 @@\n+# Check the log to get the hash\n+git log --oneline\n+\n+git reset --hard <hash>\n", "user": "jbmckee"}], "meta": "", "modified": "2026-04-06T11:29:39.119874", "publish_date": "2021-09-24T13:16:45.920995", "raw_url": "/raw/31a8fbd4a05e38940ca39a079524ee64/", "resource_uri": "/api/public/snipt/118/", "slug": "git-revert-to-previous-commit", "stylized": "<table class=\"highlighttable\"><tr><td class=\"linenos\"><div class=\"linenodiv\"><pre><a href=\"#L-1\">1</a>\n<a href=\"#L-2\">2</a>\n<a href=\"#L-3\">3</a>\n<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\n</span><span id=\"L-2\"><a name=\"L-2\"></a>git log --oneline\n</span><span id=\"L-3\"><a name=\"L-3\"></a>\n</span><span id=\"L-4\"><a name=\"L-4\"></a>git reset --hard &lt;hash&gt;\n</span></pre></div>\n</td></tr></table>", "tags": [{"absolute_url": "/public/tag/git/", "id": 17, "name": "git", "resource_uri": "/api/public/tag/17/", "snipts": "/api/public/snipt/?tag=17"}], "title": "Git revert to previous commit", "user": {"absolute_url": "/jbmckee/", "email_md5": "f4da96308b6db1b0b19738a7c105d3da", "id": 1, "resource_uri": "/api/public/user/1/", "snipts": "/api/public/snipt/?user=1", "snipts_count": 72, "username": "jbmckee"}}