🕷️ Crawler Inspector

URL Lookup

Direct Parameter Lookup

Raw Queries and Responses

1. Shard Calculation

Query:
Response:
Calculated Shard: 73 (from laksa048)

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
3 days ago
🤖
ROBOTS ALLOWED

Page Info Filters

FilterStatusConditionDetails
HTTP statusPASSdownload_http_code = 200HTTP 200
Age cutoffPASSdownload_stamp > now() - 6 MONTH0.1 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://saraford.net/2017/03/25/how-to-use-git-revert-to-undo-a-previous-commit-084/
Last Crawled2026-04-05 15:33:44 (3 days ago)
First Indexed2018-12-19 06:58:50 (7 years ago)
HTTP Status Code200
Meta TitleHow to use git revert to undo a previous commit – 084 – Sara Ford's Blog
Meta Description"undo", "reset", "revert" - ah English! Perhaps the author of The Giver used Git in the past, since one of their rules was "use precision of language." What do we mean by "undo a previous commit?" Let's say we had 3 commits A, B, and C. And we realize 'B' was a mistake. Perhaps we…
Meta Canonicalnull
Boilerpipe Text
“undo”, “reset”, “revert” – ah English! Perhaps the author of The Giver used Git in the past, since one of their rules was “use precision of language.” What do we mean by “undo a previous commit?” Let’s say we had 3 commits A, B, and C. And we realize ‘B’ was a mistake. Perhaps we changed a color to red, and it should go back to white. But we don’t want to pretend that ‘B’ never happened. That would mean modifying Git history, and Git really hates changing history if you have the repo shared with others. So yeah, you could rewrite the code to manually undo the changes introduced in ‘B’, or you could let Git do that for you by running `git revert <commitID>` As you see in the above graph, using this git visualization tool , a new commit is made with the changes introduced from ‘A’ removed. The take home message is that a new commit is made, instead of “commit A” vanishing. I like this Stack Overflow answer : If I found B I committed before is wrong, and I want to “undo” its change, git-revert -ing B will cause: A <- B <- C <- B' ^ HEAD for which B' is reversing the change done in B Now to the command line to see this in action! Say you’ve added three files: A.txt, B.txt, and C.txt for commits A, B, and C, respectively. (One day, I’m going to blog about a list of files being out of order, “dis-respectively “) We want to “undo” the changes introduced in B. —STOP!!— If you are following along at home, let’s pause for a second and make sure your core.editor is configured to use your preferred text editor. The read between the lines: you’ll want to know how to exit whatever editor comes up. Right now I’m using notepad to give me a fighting chance instead of the vi editor, aka the destoryer of CS careers . YMMV, so check out this GitHub help article on setting up an preferred text editor. Hint: it’s `git config –global core.editor notepad` if you want to use notepad across all your repos. Okay with that taken care of, let’s do the revert. We want to “undo” the B.txt commit, so let’s party w `git revert <commit id for B>` and suddenly a wild notepad appears! Since I’m cool with the default commit message “Revert ‘B’ for this demo (remember, git revert creates a new commit so it has to get a commit message from you), simply close notepad (File – Exit or ‘x’). Now if you do your git log –oneline, you’ll notice the new commit. If you do a `ls` or `dir` and the git-equivalent to see what files git is tracking `git ls-files`, you’ll see that B.txt is no where to be found. Once again to recap what we did. We could have simply deleted the file B.txt and committed those changes. But for a more complex scenario where you need to remove a feature that consists of more than a single file or line change, you should consider using `git revert`.
Markdown
[Skip to content](https://saraford.net/2017/03/25/how-to-use-git-revert-to-undo-a-previous-commit-084/#content) # [Sara Ford's Blog](https://saraford.net/) Menu - [Home](https://saraford.net/) - [About](https://saraford.net/2016/12/30/a-penultimate-guide/) - [Contact](https://saraford.net/contact/) # How to use git revert to undo a previous commit – 084 “undo”, “reset”, “revert” – ah English! Perhaps the author of [The Giver](https://www.amazon.com/Giver-Lois-Lowry/dp/B00AHG3UYA) used Git in the past, since one of their rules was “use precision of language.” What do we mean by “undo a previous commit?” Let’s say we had 3 commits A, B, and C. And we realize ‘B’ was a mistake. Perhaps we changed a color to red, and it should go back to white. But we don’t want to pretend that ‘B’ never happened. That would mean modifying Git history, and Git **really hates changing history** if you have the repo shared with others. So yeah, you could rewrite the code to manually undo the changes introduced in ‘B’, or you could let Git do that for you by running \`git revert \<commitID\>\` [![git revert \<commitID\>](https://saraford.net/wp-content/uploads/2017/03/snaghtml5190ac2_thumb.png?w=1020&h=360)](https://saraford.net/wp-content/uploads/2017/03/snaghtml5190ac2.png) As you see in the above graph, using this [git visualization tool](https://saraford.net/2017/03/22/how-to-demystify-git-commands-using-visualizing-git/), a new commit is made with the changes introduced from ‘A’ removed. The take home message is that a new commit is made, instead of “commit A” vanishing. I like this [Stack Overflow answer](http://stackoverflow.com/a/27032988): > If I found B I committed before is wrong, and I want to “undo” its change, `git-revert`\-ing B will cause: > ``` > A <- B <- C <- B' ^ HEAD > ``` > for which `B'` is reversing the change done in B Now to the command line to see this in action\! Say you’ve added three files: A.txt, B.txt, and C.txt for commits A, B, and C, respectively. *(One day, I’m going to blog about a list of files being out of order, “dis-respectively “)* We want to “undo” the changes introduced in B. [![git log showing commits A, B, C](https://saraford.net/wp-content/uploads/2017/03/image_thumb38.png?w=1020&h=463)](https://saraford.net/wp-content/uploads/2017/03/image38.png) **—STOP!!—** If you are following along at home, let’s pause for a second and make sure your core.editor is configured to use your preferred text editor. The read between the lines: you’ll want to know how to exit whatever editor comes up. [![git config --global core.editor showing notepad](https://saraford.net/wp-content/uploads/2017/03/snaghtml16271d9a_thumb.png?w=1020&h=177)](https://saraford.net/wp-content/uploads/2017/03/snaghtml16271d9a.png) Right now I’m using notepad to give me a fighting chance instead of the vi editor, aka [the destoryer of CS careers](https://saraford.net/2017/03/13/how-not-to-quit-your-career-when-git-opens-a-vi-editor-072/). YMMV, so check out this [GitHub help article](https://help.github.com/articles/associating-text-editors-with-git/) on setting up an preferred text editor. Hint: it’s \`git config –global core.editor notepad\` if you want to use notepad across all your repos. Okay with that taken care of, let’s do the revert. We want to “undo” the B.txt commit, so let’s party w \`git revert \<commit id for B\>\` and suddenly a wild notepad appears\! [![image](https://saraford.net/wp-content/uploads/2017/03/image_thumb39.png?w=1020&h=418)](https://saraford.net/wp-content/uploads/2017/03/image39.png) Since I’m cool with the default commit message “Revert ‘B’ for this demo (remember, git revert creates a new commit so it has to get a commit message from you), simply close notepad (File – Exit or ‘x’). Now if you do your git log –oneline, you’ll notice the new commit. If you do a \`ls\` or \`dir\` and the git-equivalent to see what files git is tracking \`git ls-files\`, you’ll see that B.txt is no where to be found. [![git log, ls, and git ls-files not showing B.txt](https://saraford.net/wp-content/uploads/2017/03/snaghtml163b9c8d_thumb.png?w=1020&h=641)](https://saraford.net/wp-content/uploads/2017/03/snaghtml163b9c8d.png) Once again to recap what we did. We could have simply deleted the file B.txt and committed those changes. But for a more complex scenario where you need to remove a feature that consists of more than a single file or line change, you should consider using \`git revert\`. ### Share this: - [Share on X (Opens in new window) X](https://saraford.net/2017/03/25/how-to-use-git-revert-to-undo-a-previous-commit-084/?share=twitter) - [Share on Facebook (Opens in new window) Facebook](https://saraford.net/2017/03/25/how-to-use-git-revert-to-undo-a-previous-commit-084/?share=facebook) Like Loading... - [Git(Hub) Tip of the Day 2017](https://saraford.net/category/github-tip-of-the-day-2017/) - [saraford](https://saraford.net/author/sarafordwp/) - March 25, 2017 March 24, 2017 - [git](https://saraford.net/tag/git/) - [undo](https://saraford.net/tag/undo/) ## Post navigation [How to use the VS status bar buttons as a shortcut to Team Explorer panes – 083](https://saraford.net/2017/03/24/how-to-use-the-vs-status-bar-buttons-as-a-shortcut-to-team-explorer-panes-083/) [How to revert changes in Visual Studio – 085](https://saraford.net/2017/03/26/how-to-revert-changes-in-visual-studio-085/) ### Leave a comment [Cancel reply](https://saraford.net/2017/03/25/how-to-use-git-revert-to-undo-a-previous-commit-084/#respond) [![RSS Feed](https://saraford.net/i/rss/red-medium.png)](https://saraford.net/feed/ "Subscribe to Posts") [RSS - Posts](https://saraford.net/feed/ "Subscribe to Posts") ## Categories - [Azure AD B2C](https://saraford.net/category/azure-ad-b2c/) - [Git(Hub) Tip of the Day 2017](https://saraford.net/category/github-tip-of-the-day-2017/) - [HoloLens](https://saraford.net/category/hololens/) - [Uncategorized](https://saraford.net/category/uncategorized/) - [Xamarin.Forms](https://saraford.net/category/xamarin-forms/) ## Archives - [December 2017](https://saraford.net/2017/12/) (9) - [November 2017](https://saraford.net/2017/11/) (3) - [September 2017](https://saraford.net/2017/09/) (1) - [August 2017](https://saraford.net/2017/08/) (2) - [May 2017](https://saraford.net/2017/05/) (8) - [April 2017](https://saraford.net/2017/04/) (30) - [March 2017](https://saraford.net/2017/03/) (32) - [February 2017](https://saraford.net/2017/02/) (28) - [January 2017](https://saraford.net/2017/01/) (31) - [December 2016](https://saraford.net/2016/12/) (1) [![Creative Commons License](https://i.creativecommons.org/l/by/4.0/88x31.png)](http://creativecommons.org/licenses/by/4.0/) This work is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/) - [Comment](https://saraford.net/2017/03/25/how-to-use-git-revert-to-undo-a-previous-commit-084/#respond) - [Reblog](https://saraford.net/2017/03/25/how-to-use-git-revert-to-undo-a-previous-commit-084/) - [Subscribe](https://saraford.net/2017/03/25/how-to-use-git-revert-to-undo-a-previous-commit-084/) [Subscribed](https://saraford.net/2017/03/25/how-to-use-git-revert-to-undo-a-previous-commit-084/) - [![](https://s0.wp.com/i/logo/wpcom-gray-white.png?m=1479929237i) Sara Ford's Blog](https://saraford.net/) - Already have a WordPress.com account? [Log in now.](https://wordpress.com/log-in?redirect_to=https%3A%2F%2Fr-login.wordpress.com%2Fremote-login.php%3Faction%3Dlink%26back%3Dhttps%253A%252F%252Fsaraford.net%252F2017%252F03%252F25%252Fhow-to-use-git-revert-to-undo-a-previous-commit-084%252F) - - [![](https://s0.wp.com/i/logo/wpcom-gray-white.png?m=1479929237i) Sara Ford's Blog](https://saraford.net/) - [Subscribe](https://saraford.net/2017/03/25/how-to-use-git-revert-to-undo-a-previous-commit-084/) [Subscribed](https://saraford.net/2017/03/25/how-to-use-git-revert-to-undo-a-previous-commit-084/) - [Sign up](https://wordpress.com/start/) - [Log in](https://wordpress.com/log-in?redirect_to=https%3A%2F%2Fr-login.wordpress.com%2Fremote-login.php%3Faction%3Dlink%26back%3Dhttps%253A%252F%252Fsaraford.net%252F2017%252F03%252F25%252Fhow-to-use-git-revert-to-undo-a-previous-commit-084%252F) - [Copy shortlink](https://wp.me/p8bPK8-p1) - [Report this content](https://wordpress.com/abuse/?report_url=https://saraford.net/2017/03/25/how-to-use-git-revert-to-undo-a-previous-commit-084/) - [View post in Reader](https://wordpress.com/reader/blogs/121031200/posts/1551) - [Manage subscriptions](https://subscribe.wordpress.com/) - [Collapse this bar](https://saraford.net/2017/03/25/how-to-use-git-revert-to-undo-a-previous-commit-084/) %d ![](https://pixel.wp.com/b.gif?v=noscript)
Readable Markdown
“undo”, “reset”, “revert” – ah English! Perhaps the author of [The Giver](https://www.amazon.com/Giver-Lois-Lowry/dp/B00AHG3UYA) used Git in the past, since one of their rules was “use precision of language.” What do we mean by “undo a previous commit?” Let’s say we had 3 commits A, B, and C. And we realize ‘B’ was a mistake. Perhaps we changed a color to red, and it should go back to white. But we don’t want to pretend that ‘B’ never happened. That would mean modifying Git history, and Git **really hates changing history** if you have the repo shared with others. So yeah, you could rewrite the code to manually undo the changes introduced in ‘B’, or you could let Git do that for you by running \`git revert \<commitID\>\` [![git revert \<commitID\>](https://saraford.net/wp-content/uploads/2017/03/snaghtml5190ac2_thumb.png?w=1020&h=360)](https://saraford.net/wp-content/uploads/2017/03/snaghtml5190ac2.png) As you see in the above graph, using this [git visualization tool](https://saraford.net/2017/03/22/how-to-demystify-git-commands-using-visualizing-git/), a new commit is made with the changes introduced from ‘A’ removed. The take home message is that a new commit is made, instead of “commit A” vanishing. I like this [Stack Overflow answer](http://stackoverflow.com/a/27032988): > If I found B I committed before is wrong, and I want to “undo” its change, `git-revert`\-ing B will cause: > ``` > A <- B <- C <- B' ^ HEAD > ``` > for which `B'` is reversing the change done in B Now to the command line to see this in action\! Say you’ve added three files: A.txt, B.txt, and C.txt for commits A, B, and C, respectively. *(One day, I’m going to blog about a list of files being out of order, “dis-respectively “)* We want to “undo” the changes introduced in B. [![git log showing commits A, B, C](https://saraford.net/wp-content/uploads/2017/03/image_thumb38.png?w=1020&h=463)](https://saraford.net/wp-content/uploads/2017/03/image38.png) **—STOP!!—** If you are following along at home, let’s pause for a second and make sure your core.editor is configured to use your preferred text editor. The read between the lines: you’ll want to know how to exit whatever editor comes up. [![git config --global core.editor showing notepad](https://saraford.net/wp-content/uploads/2017/03/snaghtml16271d9a_thumb.png?w=1020&h=177)](https://saraford.net/wp-content/uploads/2017/03/snaghtml16271d9a.png) Right now I’m using notepad to give me a fighting chance instead of the vi editor, aka [the destoryer of CS careers](https://saraford.net/2017/03/13/how-not-to-quit-your-career-when-git-opens-a-vi-editor-072/). YMMV, so check out this [GitHub help article](https://help.github.com/articles/associating-text-editors-with-git/) on setting up an preferred text editor. Hint: it’s \`git config –global core.editor notepad\` if you want to use notepad across all your repos. Okay with that taken care of, let’s do the revert. We want to “undo” the B.txt commit, so let’s party w \`git revert \<commit id for B\>\` and suddenly a wild notepad appears\! [![image](https://saraford.net/wp-content/uploads/2017/03/image_thumb39.png?w=1020&h=418)](https://saraford.net/wp-content/uploads/2017/03/image39.png) Since I’m cool with the default commit message “Revert ‘B’ for this demo (remember, git revert creates a new commit so it has to get a commit message from you), simply close notepad (File – Exit or ‘x’). Now if you do your git log –oneline, you’ll notice the new commit. If you do a \`ls\` or \`dir\` and the git-equivalent to see what files git is tracking \`git ls-files\`, you’ll see that B.txt is no where to be found. [![git log, ls, and git ls-files not showing B.txt](https://saraford.net/wp-content/uploads/2017/03/snaghtml163b9c8d_thumb.png?w=1020&h=641)](https://saraford.net/wp-content/uploads/2017/03/snaghtml163b9c8d.png) Once again to recap what we did. We could have simply deleted the file B.txt and committed those changes. But for a more complex scenario where you need to remove a feature that consists of more than a single file or line change, you should consider using \`git revert\`.
Shard73 (laksa)
Root Hash9174383430988781073
Unparsed URLnet,saraford!/2017/03/25/how-to-use-git-revert-to-undo-a-previous-commit-084/ s443