🕷️ Crawler Inspector

URL Lookup

Direct Parameter Lookup

Raw Queries and Responses

1. Shard Calculation

Query:
Response:
Calculated Shard: 191 (from laksa187)

2. Crawled Status Check

Query:
Response:

3. Robots.txt Check

Query:
Response:

4. Spam/Ban Check

Query:
Response:

5. Seen Status Check

ℹ️ Skipped - page is already crawled

📄
INDEXABLE
CRAWLED
1 month ago
🤖
ROBOTS ALLOWED

Page Info Filters

FilterStatusConditionDetails
HTTP statusPASSdownload_http_code = 200HTTP 200
Age cutoffPASSdownload_stamp > now() - 6 MONTH1.2 months ago
History dropPASSisNull(history_drop_reason)No drop reason
Spam/banPASSfh_dont_index != 1 AND ml_spam_score = 0ml_spam_score=0
CanonicalPASSmeta_canonical IS NULL OR = '' OR = src_unparsedNot set

Page Details

PropertyValue
URLhttps://circlecoder.com/how-to-revert-a-git-repository-to-a-previous-commit/
Last Crawled2026-03-08 23:20:27 (1 month ago)
First Indexed2021-11-10 09:16:55 (4 years ago)
HTTP Status Code200
Meta TitleHow to Revert a Git Repository to a Previous Commit | CircleCoder
Meta DescriptionShort answers to the question how to revert a git repository to a previous commit.
Meta Canonicalnull
Boilerpipe Text
Scenario A: Temporarily Switch to a Different Commit 1 $ git checkout 0d1d7fc32 The above command will: checkout the desired commit detach your HEAD (leave you with no branch checked out) Scenario B: Hard Delete Unpublished Commits 1 $ git reset --hard 0d1d7fc32 The above command will: destroy any local modifications if you want to keep uncommitted work, use git stash Scenario C: Undo Published Commits With New Commits 1 $ git revert 0d1d7fc32 25eee4ca or 1 $ git revert --no-commit 0d1d7fc32..HEAD or 1 $ git revert -m 1 <merge_commit_sha> The first command will: create two separate revert commits revert the two commits The second command will: revert everything from the HEAD back to the commit hash --no-commit flag lets git revert all the commits at once The third command will: revert a merge commit
Markdown
### [CircleCoder](https://circlecoder.com/index.html) - [Posts](https://circlecoder.com/index.html) - [Topics](https://circlecoder.com/how-to-revert-a-git-repository-to-a-previous-commit/) [All Topics](https://circlecoder.com/topics.html) [LeetCode](https://circlecoder.com/leetcode-solution-list/) [LeetCode Database](https://circlecoder.com/leetcode-database-solution-list/) [Git Short Answers](https://circlecoder.com/git-short-answers-list/) [MySQL](https://circlecoder.com/mysql-tutorial-list/) [Operating System](https://circlecoder.com/operating-system-topic-list/) [Object Oriented Design](https://circlecoder.com/object-oriented-design-topic-list/) [C++ Concepts](https://circlecoder.com/cplusplus-concept-list/) Topics Share # How to Revert a Git Repository to a Previous Commit ##### Scenario A: Temporarily Switch to a Different Commit ``` ``` The above command will: - checkout the desired commit - detach your HEAD (leave you with no branch checked out) ##### Scenario B: Hard Delete Unpublished Commits ``` ``` The above command will: - destroy any local modifications - if you want to keep uncommitted work, use `git stash` ##### Scenario C: Undo Published Commits With New Commits ``` ``` or ``` ``` or ``` ``` The first command will: - create two separate revert commits - revert the two commits The second command will: - revert everything from the HEAD back to the commit hash - `--no-commit` flag lets git revert all the commits at once The third command will: - revert a merge commit 09 Nov 2021 - [Git](https://circlecoder.com/categories#Git) - [\#Git Revert](https://circlecoder.com/tags#Git-Revert) [« How to Modify Existing Unpushed Commit Messages](https://circlecoder.com/how-to-modify-existing-unpushed-commit-messages/) [What is the Difference Between Git Pull and Git Fetch »](https://circlecoder.com/what-is-the-difference-between-git-pull-and-git-fetch/) ## Related Posts ## [What is the Difference Between Git Pull and Git Fetch](https://circlecoder.com/what-is-the-difference-between-git-pull-and-git-fetch/) #### Short answers to the question what is the difference between... [Git](https://circlecoder.com/how-to-revert-a-git-repository-to-a-previous-commit/) [Git Pull](https://circlecoder.com/how-to-revert-a-git-repository-to-a-previous-commit/) 09 Nov 2021 ## [How to Revert a Git Repository to a Previous Commit](https://circlecoder.com/how-to-revert-a-git-repository-to-a-previous-commit/) #### Short answers to the question how to revert a git... [Git](https://circlecoder.com/how-to-revert-a-git-repository-to-a-previous-commit/) [Git Revert](https://circlecoder.com/how-to-revert-a-git-repository-to-a-previous-commit/) 09 Nov 2021 ## [How to Modify Existing Unpushed Commit Messages](https://circlecoder.com/how-to-modify-existing-unpushed-commit-messages/) #### Short answers to the question how to modify existing unpushed... [Git](https://circlecoder.com/how-to-revert-a-git-repository-to-a-previous-commit/) [Git Commit](https://circlecoder.com/how-to-revert-a-git-repository-to-a-previous-commit/) 09 Nov 2021 ## [How to Undo a Git Add Before Commit](https://circlecoder.com/how-to-undo-a-git-add-before-commit/) #### Short answers to the question how to undo a git... [Git](https://circlecoder.com/how-to-revert-a-git-repository-to-a-previous-commit/) [Git Reset](https://circlecoder.com/how-to-revert-a-git-repository-to-a-previous-commit/) 04 Nov 2021 ## [How to Rename a Local Git Branch](https://circlecoder.com/how-to-rename-a-local-git-branch/) #### Short answers to the question how to rename a local... [Git](https://circlecoder.com/how-to-revert-a-git-repository-to-a-previous-commit/) [Git Branch](https://circlecoder.com/how-to-revert-a-git-repository-to-a-previous-commit/) 04 Nov 2021 ## [How to Delete a Git Branch Locally and Remotely](https://circlecoder.com/how-to-delete-a-git-branch-locally-and-remotely/) #### Short answers to the question how to delete a git... [Git](https://circlecoder.com/how-to-revert-a-git-repository-to-a-previous-commit/) [Git Branch](https://circlecoder.com/how-to-revert-a-git-repository-to-a-previous-commit/) 04 Nov 2021 Copyright © 2024 CircleCoder \| All Rights Reserved \| [Phair.io](https://phair.io/) \| [Patternful.ai](https://patternful.ai/)
Readable Markdown
##### Scenario A: Temporarily Switch to a Different Commit ``` ``` The above command will: - checkout the desired commit - detach your HEAD (leave you with no branch checked out) ##### Scenario B: Hard Delete Unpublished Commits ``` ``` The above command will: - destroy any local modifications - if you want to keep uncommitted work, use `git stash` ##### Scenario C: Undo Published Commits With New Commits ``` ``` or ``` ``` or ``` ``` The first command will: - create two separate revert commits - revert the two commits The second command will: - revert everything from the HEAD back to the commit hash - `--no-commit` flag lets git revert all the commits at once The third command will: - revert a merge commit
Shard191 (laksa)
Root Hash1093013983554932391
Unparsed URLcom,circlecoder!/how-to-revert-a-git-repository-to-a-previous-commit/ s443