{"id":115607,"date":"2022-10-07T15:00:00","date_gmt":"2022-10-07T12:00:00","guid":{"rendered":"https:\/\/examples.javacodegeeks.com\/?p=115607"},"modified":"2022-10-07T12:15:53","modified_gmt":"2022-10-07T09:15:53","slug":"git-revert-commit-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/","title":{"rendered":"Git Revert Commit Example"},"content":{"rendered":"<h2 class=\"wp-block-heading\" id=\"h-1-introduction\">1. Introduction<\/h2>\n<p>This is an in-depth article related to the Git Revert Commit. Git was developed by Vincent Driessen in 2010. The git revert command is used to remove all the changes done in a single commit made to your source code repository.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-2-git-revert-commit\">2. Git Revert Commit<\/h2>\n<p>You can revert a commit that you made to Git.  In some cases, a set of commits can be reverted. This occurs when there is a build problem that came up because of a commit. It is an operation that is equivalent to simple undo in the repository.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-2-1-prerequisites\">2.1 Prerequisites<\/h3>\n<p>Java 7 or 8 is required on the Linux, windows, or mac operating system. Maven 3.6.1 is required for building this application. &nbsp;A GitHub account is required.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-2-2-download\">2.2 Download<\/h3>\n<p>You can download Java 8 can be downloaded from the Oracle <a href=\"https:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/jdk8-downloads-2133151.html\">website<\/a>.&nbsp;Apache Maven 3.6.1 can be downloaded from the Apache site. GitHub can be accessed at this&nbsp;<a href=\"http:\/\/www.github.com\">link<\/a>. Gitkraken can be downloaded from this&nbsp;<a href=\"https:\/\/www.gitkraken.com\">site<\/a>. Git can be downloaded from this&nbsp;<a href=\"https:\/\/git-scm.com\">link<\/a>.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-2-3-setup\">2.3 Setup<\/h3>\n<p>You can create an account on GitHub account using the&nbsp;<a href=\"http:\/\/www.github.com\">link<\/a>. You can create a GitHub repository with a Calculator application java code. You can add the file manually to get started. The code is shown below :<\/p>\n<p><span style=\"text-decoration: underline\"><em>Calculator<\/em><\/span><\/p>\n<pre class=\"brush:java\">package org.build.maventool;\n\n\/**\n *  Calculator class\n *\/\npublic class Calculator\n{\n   \/**\n    * getProduct\n    * @param val1 integer\n    * @param val2 integer\n    * @return product of val1 and val2\n    *\/\n   public int getProduct(int val1, int val2)\n    {\n\t\t   return val1*val2;\n    }\n   \n   \/**\n    * main method\n    * @param args arguments\n    *\/\n   public static void main(String[] args)\n   {\n        Calculator calc = new Calculator();\n       \n        int product = calc.getProduct(43,4);\n       \n        System.out.println(\"Product of \" + \" 43 and 4 is \"+product);\n   }\n}\n\n<\/pre>\n<p>You can use the below maven pom for building this file.<\/p>\n<p><span style=\"text-decoration: underline\"><em>maven pom.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\"\n         xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\n         xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\"&gt;\n    &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\n    &lt;groupId&gt;maven-hello&lt;\/groupId&gt;\n    &lt;artifactId&gt;Maven-project&lt;\/artifactId&gt;\n    &lt;packaging&gt;jar&lt;\/packaging&gt;\n    &lt;version&gt;1.0&lt;\/version&gt;\n    &lt;name&gt;Maven-project&lt;\/name&gt;\n    &lt;url&gt;http:\/\/maven.apache.org&lt;\/url&gt;\n \n    &lt;properties&gt;\n         \n        &lt;project.build.sourceEncoding&gt;UTF-8&lt;\/project.build.sourceEncoding&gt;\n        &lt;maven.compiler.source&gt;1.8&lt;\/maven.compiler.source&gt;\n        &lt;maven.compiler.target&gt;1.8&lt;\/maven.compiler.target&gt;\n    &lt;\/properties&gt;\n \n    &lt;dependencies&gt;\n        &lt;dependency&gt;\n            &lt;groupId&gt;junit&lt;\/groupId&gt;\n            &lt;artifactId&gt;junit&lt;\/artifactId&gt;\n            &lt;version&gt;4.12&lt;\/version&gt;\n            &lt;scope&gt;test&lt;\/scope&gt;\n        &lt;\/dependency&gt;\n        &lt;dependency&gt;\n            &lt;groupId&gt;commons-codec&lt;\/groupId&gt;\n            &lt;artifactId&gt;commons-codec&lt;\/artifactId&gt;\n            &lt;version&gt;1.11&lt;\/version&gt;\n        &lt;\/dependency&gt;\n    &lt;\/dependencies&gt;\n    &lt;build&gt;\n        &lt;plugins&gt;\n            &lt;plugin&gt;\n                &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt;\n                &lt;artifactId&gt;maven-shade-plugin&lt;\/artifactId&gt;\n                &lt;version&gt;3.2.0&lt;\/version&gt;\n                &lt;executions&gt;\n \n                    &lt;execution&gt;\n                        &lt;phase&gt;package&lt;\/phase&gt;\n                        &lt;goals&gt;\n                            &lt;goal&gt;shade&lt;\/goal&gt;\n                        &lt;\/goals&gt;\n                        &lt;configuration&gt;\n                            &lt;transformers&gt;\n                                &lt;transformer\n                                        implementation=\"org.apache.maven.plugins.shade.resource.ManifestResourceTransformer\"&gt;\n                                    &lt;mainClass&gt;org.build.maventool.Calculator&lt;\/mainClass&gt;\n                                &lt;\/transformer&gt;\n                            &lt;\/transformers&gt;\n                        &lt;\/configuration&gt;\n                    &lt;\/execution&gt;\n                &lt;\/executions&gt;\n            &lt;\/plugin&gt;\n        &lt;\/plugins&gt;\n    &lt;\/build&gt;\n&lt;\/project&gt;\n<\/pre>\n<h3 class=\"wp-block-heading\" id=\"h-2-4-importance-of-git-revert\">2.4 Importance of git revert<\/h3>\n<p>Git revert is important and valuable when you have multiple developers working together in the same repository. Git revisions are part of a git commit. A commit is identified by sha and it is unique. Similarly, the branch names are identified by characters followed by ~ and the number of commits behind the head commit. Git revert deletes the commit from the local workspace and not from the local repository.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h3 class=\"wp-block-heading\" id=\"h-2-5-reverting-a-commit-with-git-revert\">2.5 Reverting a Commit With git revert<\/h3>\n<p>Let us take an example where there is an edit to the java class. The code is shown below:<\/p>\n<\/p>\n<p><span style=\"text-decoration: underline\"><em>Modified Calculator class<\/em><\/span><\/p>\n<pre class=\"brush:java\">package org.build.maventool;\n\n\/**\n *  Calculator class\n *\/\npublic class Calculator\n{\n   \/**\n    * getProduct\n    * @param val1 integer\n    * @param val2 integer\n    * @return product of val1 and val2\n    *\/\n   public int getProduct(int val1, int val2)\n    {\n\t\t   return val1*val2;\n    }\n   \n \/**\n    * getSum\n    * @param val1 integer\n    * @param val2 integer\n    * @return sum of val1 and val2\n    *\/\n   public int getSum(int val1, int val2)\n    {\n\t\t   return val1+val2;\n    }\n   \/**\n    * main method\n    * @param args arguments\n    *\/\n   public static void main(String[] args)\n   {\n        Calculator calc = new Calculator();\n       \n        int product = calc.getProduct(43,4);\n       \n        System.out.println(\"Product of \" + \" 43 and 4 is \"+product);\n\n        int sum = calc.getSum(43,4);\n       \n        System.out.println(\"Sum of \" + \" 43 and 4 is \"+sum);\n   }\n}\n\n<\/pre>\n<p>This code is committed to a repository created in GitHub. The below commands are used.<\/p>\n<\/p>\n<p><span style=\"text-decoration: underline\"><em>Commands for commit<\/em><\/span><\/p>\n<pre class=\"brush:plain\">(base) apples-MacBook-Air:opensource bhagvan.kommadi$ git clone https:\/\/github.com\/bhagvank\/gitexamples.git\nCloning into 'gitexamples'...\nremote: Enumerating objects: 3, done.\nremote: Counting objects: 100% (3\/3), done.\nremote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0\nUnpacking objects: 100% (3\/3), done.\n(base) apples-MacBook-Air:opensource bhagvan.kommadi$ pwd\n\/Users\/bhagvan.kommadi\/olddesk\/opensource\n(base) apples-MacBook-Air:opensource bhagvan.kommadi$ ls\nNoCodeAIML\t\tgitexamples\t\ttensorflowexamples\ncomputer_vision\t\tspringexamples\n(base) apples-MacBook-Air:opensource bhagvan.kommadi$ cd gitexamples\/\n(base) apples-MacBook-Air:gitexamples bhagvan.kommadi$ ls\nMavenHello\tREADME.md\n(base) apples-MacBook-Air:gitexamples bhagvan.kommadi$ git add .\n(base) apples-MacBook-Air:gitexamples bhagvan.kommadi$ git commit -m \"added modified calculator code\"\n[main 9fe8866] added modified calculator code\n 5 files changed, 191 insertions(+)\n create mode 100755 MavenHello\/README.md\n create mode 100644 MavenHello\/dependency-reduced-pom.xml\n create mode 100755 MavenHello\/pom.xml\n create mode 100755 MavenHello\/src\/main\/java\/org\/build\/maventool\/Calculator.java\n create mode 100755 MavenHello\/src\/test\/java\/org\/build\/maventool\/CalculatorTest.java\n(base) apples-MacBook-Air:gitexamples bhagvan.kommadi$\n<\/pre>\n<p>Now add a line in the java code for printing a message. The modified code is shown below:<\/p>\n<\/p>\n<p><span style=\"text-decoration: underline\"><em>Calculator class added a new line<\/em><\/span><\/p>\n<pre class=\"brush:java\">package org.build.maventool;\n\n\/**\n *  Calculator class\n *\/\npublic class Calculator\n{\n   \/**\n    * getProduct\n    * @param val1 integer\n    * @param val2 integer\n    * @return product of val1 and val2\n    *\/\n   public int getProduct(int val1, int val2)\n    {\n\t\t   return val1*val2;\n    }\n   \n \/**\n    * getSum\n    * @param val1 integer\n    * @param val2 integer\n    * @return sum of val1 and val2\n    *\/\n   public int getSum(int val1, int val2)\n    {\n\t\t   return val1+val2;\n    }\n   \/**\n    * main method\n    * @param args arguments\n    *\/\n   public static void main(String[] args)\n   {\n        Calculator calc = new Calculator();\n       \n        int product = calc.getProduct(43,4);\n       \n        System.out.println(\"Product of \" + \" 43 and 4 is \"+product);\n\n        int sum = calc.getSum(43,4);\n       \n        System.out.println(\"Sum of \" + \" 43 and 4 is \"+sum);\n\n        System.out.println(\"New message\");\n   }\n}\n\n<\/pre>\n<p>Try first commit this change and then revert the change using the commands below:<\/p>\n<\/p>\n<p><span style=\"text-decoration: underline\"><em>Commands to commit and revert commit<\/em><\/span><\/p>\n<pre class=\"brush:plain\">(base) apples-MacBook-Air:MavenHello bhagvan.kommadi$ git status\nOn branch main\nYour branch is ahead of 'origin\/main' by 1 commit.\n  (use \"git push\" to publish your local commits)\nChanges not staged for commit:\n  (use \"git add ...\" to update what will be committed)\n  (use \"git checkout -- ...\" to discard changes in working directory)\n\n\tmodified:   src\/main\/java\/org\/build\/maventool\/Calculator.java\n\nno changes added to commit (use \"git add\" and\/or \"git commit -a\")\n(base) apples-MacBook-Air:MavenHello bhagvan.kommadi$ git add .\n(base) apples-MacBook-Air:MavenHello bhagvan.kommadi$ git commit -m \"added a new line\"\n[main 61b377c] added a new line\n 1 file changed, 1 insertion(+)\n(base) apples-MacBook-Air:MavenHello bhagvan.kommadi$ git revert 61b377c\n[main 944d7b2] Revert \"added a new line\"\n 1 file changed, 1 deletion(-)\n<\/pre>\n<p>The git revert commit command removes the changes, and a new commit is created to identify the new state of your repository.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-2-6-compare-git-revert-vs-reset\">2.6 Compare git revert vs. reset<\/h3>\n<p>When you want to undo a set of changes associated with a commit, you can use the git revert commit command.  In the case of undoing every change from a given commit, you need to use a hard git reset. In another case where hard resetting files to HEAD on git needs to be done, the git reset command is used &#8211;hard option.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-2-7-git-revert-options\">2.7 git revert options<\/h3>\n<p>The syntax to revert a commit and undo unwanted changes is simple. All developers need to do is issue the git revert command and provide the ID of the commit to undo:<\/p>\n<p><span style=\"text-decoration: underline\"><em>git revert commit command options<\/em><\/span><\/p>\n<pre class=\"brush:plain\">\u2026\u200b\nCommits to revert. For a more complete list of ways to spell commit names, see gitrevisions[7]. Sets of commits can also be given but no traversal is done by default, see git-rev-list[1] and its --no-walk option.\n\n-e\n--edit\nWith this option, git revert will let you edit the commit message prior to committing the revert. This is the default if you run the command from a terminal.\n\n-m parent-number\n--mainline parent-number\nUsually you cannot revert a merge because you do not know which side of the merge should be considered the mainline. This option specifies the parent number (starting from 1) of the mainline and allows revert to reverse the change relative to the specified parent.\n\nReverting a merge commit declares that you will never want the tree changes brought in by the merge. As a result, later merges will only bring in tree changes introduced by commits that are not ancestors of the previously reverted merge. This may or may not be what you want.\n\nSee the revert-a-faulty-merge How-To for more details.\n\n--no-edit\nWith this option, git revert will not start the commit message editor.\n\n--cleanup=\nThis option determines how the commit message will be cleaned up before being passed on to the commit machinery. See git-commit[1] for more details. In particular, if the  is given a value of scissors, scissors will be appended to MERGE_MSG before being passed on in the case of a conflict.\n\n-n\n--no-commit\nUsually the command automatically creates some commits with commit log messages stating which commits were reverted. This flag applies the changes necessary to revert the named commits to your working tree and the index, but does not make the commits. In addition, when this option is used, your index does not have to match the HEAD commit. The revert is done against the beginning state of your index.\n\nThis is useful when reverting more than one commits' effect to your index in a row.\n\n-S[]\n--gpg-sign[=]\n--no-gpg-sign\nGPG-sign commits. The keyid argument is optional and defaults to the committer identity; if specified, it must be stuck to the option without a space. --no-gpg-sign is useful to countermand both commit.gpgSign configuration variable, and earlier --gpg-sign.\n\n-s\n--signoff\nAdd a Signed-off-by trailer at the end of the commit message. See the signoff option in git-commit[1] for more information.\n\n--strategy=\nUse the given merge strategy. Should only be used once. See the MERGE STRATEGIES section in git-merge[1] for details.\n\n-X\n--strategy-option=\nPass the merge strategy-specific option through to the merge strategy. See git-merge[1] for details.\n\n--rerere-autoupdate\n--no-rerere-autoupdate\nAllow the rerere mechanism to update the index with the result of auto-conflict resolution if possible.\n\n--reference\nInstead of starting the body of the log message with \"This reverts .\", refer to the commit using \"--pretty=reference\" format (cf. git-log[1]). The revert.reference configuration variable can be used to enable this option by default.\n\n<\/pre>\n<h2 class=\"wp-block-heading\" id=\"h-3-download-the-source-code\">3. Download the Source Code<\/h2>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here:<a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/10\/git_revert_commit.zip\"> <strong>Git Revert Commit Example<\/strong><\/a><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction This is an in-depth article related to the Git Revert Commit. Git was developed by Vincent Driessen in 2010. The git revert command is used to remove all the changes done in a single commit made to your source code repository. 2. Git Revert Commit You can revert a commit that you made &hellip;<\/p>\n","protected":false},"author":31,"featured_media":27377,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1353],"tags":[],"class_list":["post-115607","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-git"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Git Revert Commit Example - Examples Java Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"This is an in-depth article related to the Git Revert Commit. Git was developed by Vincent Driessen in 2010. The git revert command...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git Revert Commit Example - Examples Java Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"This is an in-depth article related to the Git Revert Commit. Git was developed by Vincent Driessen in 2010. The git revert command...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/bhagvank\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-07T12:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Bhagvan Kommadi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bhaggu\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bhagvan Kommadi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/\"},\"author\":{\"name\":\"Bhagvan Kommadi\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/4575ae335b8ff016be62c3b927d5d5e6\"},\"headline\":\"Git Revert Commit Example\",\"datePublished\":\"2022-10-07T12:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/\"},\"wordCount\":535,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"articleSection\":[\"Git\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/\",\"name\":\"Git Revert Commit Example - Examples Java Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"datePublished\":\"2022-10-07T12:00:00+00:00\",\"description\":\"This is an in-depth article related to the Git Revert Commit. Git was developed by Vincent Driessen in 2010. The git revert command...\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Software Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/software-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Git\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/software-development\/git\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Git Revert Commit Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/4575ae335b8ff016be62c3b927d5d5e6\",\"name\":\"Bhagvan Kommadi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/02\/bhagvan.-kommadi-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/02\/bhagvan.-kommadi-96x96.jpg\",\"caption\":\"Bhagvan Kommadi\"},\"description\":\"Bhagvan Kommadi is the Founder of Architect Corner &amp; has around 20 years\u2019 experience in the industry, ranging from large scale enterprise development to helping incubate software product start-ups. He has done Masters in Industrial Systems Engineering at Georgia Institute of Technology (1997) and Bachelors in Aerospace Engineering from Indian Institute of Technology, Madras (1993). He is member of IFX forum,Oracle JCP and participant in Java Community Process. He founded Quantica Computacao, the first quantum computing startup in India. Markets and Markets have positioned Quantica Computacao in \u2018Emerging Companies\u2019 section of Quantum Computing quadrants. Bhagvan has engineered and developed simulators and tools in the area of quantum technology using IBM Q, Microsoft Q# and Google QScript. He has reviewed the Manning book titled : \\\"Machine Learning with TensorFlow\u201d. He is also the author of Packt Publishing book - \\\"Hands-On Data Structures and Algorithms with Go\\\".He is member of IFX forum,Oracle JCP and participant in Java Community Process. He is member of the MIT Technology Review Global Panel.\",\"sameAs\":[\"http:\/\/www.architectcorner.com\",\"https:\/\/www.facebook.com\/bhagvank\",\"https:\/\/in.linkedin.com\/pub\/bhagvan-kommadi\/0\/3a6\/b46\",\"https:\/\/x.com\/bhaggu\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/bhagvan-kommadi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Git Revert Commit Example - Examples Java Code Geeks - 2026","description":"This is an in-depth article related to the Git Revert Commit. Git was developed by Vincent Driessen in 2010. The git revert command...","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/","og_locale":"en_US","og_type":"article","og_title":"Git Revert Commit Example - Examples Java Code Geeks - 2026","og_description":"This is an in-depth article related to the Git Revert Commit. Git was developed by Vincent Driessen in 2010. The git revert command...","og_url":"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_author":"https:\/\/www.facebook.com\/bhagvank","article_published_time":"2022-10-07T12:00:00+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","type":"image\/jpeg"}],"author":"Bhagvan Kommadi","twitter_card":"summary_large_image","twitter_creator":"@bhaggu","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Bhagvan Kommadi","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/"},"author":{"name":"Bhagvan Kommadi","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/4575ae335b8ff016be62c3b927d5d5e6"},"headline":"Git Revert Commit Example","datePublished":"2022-10-07T12:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/"},"wordCount":535,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","articleSection":["Git"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/","url":"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/","name":"Git Revert Commit Example - Examples Java Code Geeks - 2026","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","datePublished":"2022-10-07T12:00:00+00:00","description":"This is an in-depth article related to the Git Revert Commit. Git was developed by Vincent Driessen in 2010. The git revert command...","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/git-revert-commit-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Software Development","item":"https:\/\/examples.javacodegeeks.com\/category\/software-development\/"},{"@type":"ListItem","position":3,"name":"Git","item":"https:\/\/examples.javacodegeeks.com\/category\/software-development\/git\/"},{"@type":"ListItem","position":4,"name":"Git Revert Commit Example"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/4575ae335b8ff016be62c3b927d5d5e6","name":"Bhagvan Kommadi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/02\/bhagvan.-kommadi-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/02\/bhagvan.-kommadi-96x96.jpg","caption":"Bhagvan Kommadi"},"description":"Bhagvan Kommadi is the Founder of Architect Corner &amp; has around 20 years\u2019 experience in the industry, ranging from large scale enterprise development to helping incubate software product start-ups. He has done Masters in Industrial Systems Engineering at Georgia Institute of Technology (1997) and Bachelors in Aerospace Engineering from Indian Institute of Technology, Madras (1993). He is member of IFX forum,Oracle JCP and participant in Java Community Process. He founded Quantica Computacao, the first quantum computing startup in India. Markets and Markets have positioned Quantica Computacao in \u2018Emerging Companies\u2019 section of Quantum Computing quadrants. Bhagvan has engineered and developed simulators and tools in the area of quantum technology using IBM Q, Microsoft Q# and Google QScript. He has reviewed the Manning book titled : \"Machine Learning with TensorFlow\u201d. He is also the author of Packt Publishing book - \"Hands-On Data Structures and Algorithms with Go\".He is member of IFX forum,Oracle JCP and participant in Java Community Process. He is member of the MIT Technology Review Global Panel.","sameAs":["http:\/\/www.architectcorner.com","https:\/\/www.facebook.com\/bhagvank","https:\/\/in.linkedin.com\/pub\/bhagvan-kommadi\/0\/3a6\/b46","https:\/\/x.com\/bhaggu"],"url":"https:\/\/examples.javacodegeeks.com\/author\/bhagvan-kommadi\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/115607","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/31"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=115607"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/115607\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/27377"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=115607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=115607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=115607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}