{"id":28402,"date":"2015-11-20T11:00:54","date_gmt":"2015-11-20T09:00:54","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=28402"},"modified":"2019-04-23T14:55:34","modified_gmt":"2019-04-23T11:55:34","slug":"git-remove-commit-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/","title":{"rendered":"Git Remove Commit Example"},"content":{"rendered":"<p>In this example, we shall show how to remove commits from our git&#8217;s log history. As we can see, we can commit every time we want because these commits will persist in our local machine and nobody can access to them if push have not been performed to the git central repository. Commit every change is really good but what if one change does not make sense? That is the perfect moment to apply <code>git reset<\/code> command and undo changes.<\/p>\n<p>We must take into that we can not &nbsp;undo changes all the time unless you&nbsp;have been working against your local repository. If you undo changes from git central repository you must perform <code>git push --force<\/code> or <code>git push -f<\/code> in order to rewrite the log history. &nbsp;Take care to do this if the code is shared with other members.<\/p>\n<p>&nbsp;<br \/>\nIn the image below, we can see all the commits we have performed in our local repository. The example is very simple, basically we have upgraded the spring-boot version in each commit.<\/p>\n<p><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/git-remove-commit-example.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-28776\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/git-remove-commit-example.jpg\" alt=\"git-remove-commit-example\" width=\"640\" height=\"398\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/git-remove-commit-example.jpg 640w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/git-remove-commit-example-300x187.jpg 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<h2>1. Undoing changes with reset<\/h2>\n<p><strong>Want to undo changes?<\/strong> Then, <code>git reset<\/code> is the simple way to do that. We just need to use&nbsp;the following command:<\/p>\n<pre class=\"brush:bash\">git reset &lt;commit&gt;<\/pre>\n<p>Once <code>git reset<\/code> has been performed files involved in the commit are ready to be taken from garbage collector.<\/p>\n<p>The list below show some flags supported by <code>git reset<\/code> command:<\/p>\n<ul>\n<li><code>--soft<\/code>, remove&nbsp;commit&nbsp;but keep changes on track to commit again.\n<pre class=\"brush:bash\">git reset --soft &lt;commit&gt;\n<\/pre>\n<p>Imagine we want to come back to version 1.0.0.RC1 then we have to perform.<\/p>\n<pre class=\"brush:bash\">git reset --soft 17222ce\n<\/pre>\n<p>Perform <code>git status<\/code> and the terminal will tell us that changes are in the stage.<\/p>\n<pre class=\"brush:bash\">On branch master\nChanges to be committed:\n  (use \"git reset HEAD ...\" to unstage)\n\n\tmodified:   pom.xml\n<\/pre>\n<\/li>\n<li><code>--mixed<\/code>, remove commit but keep changes to be added on stage.\n<pre class=\"brush:bash\">git reset --mixed &lt;commit&gt;\n<\/pre>\n<p>For any reason, we want to come back to version 1.0.0.M5 then we have to perform.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\"brush:bash\">git reset --mixed 22d157d\n<\/pre>\n<p>Perform <code>git status<\/code> and the terminal will tell us that changes are not in the stage.<\/p>\n<pre class=\"brush:bash\">On branch master\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:   pom.xml\n<\/pre>\n<\/li>\n<li><code>--hard<\/code>, remove commit and undo&nbsp;changes.\n<pre class=\"brush:bash\">git reset --hard &lt;commit&gt;\n<\/pre>\n<p>Perform <code>git status<\/code> and the terminal won&#8217;t display anything.<\/li>\n<\/ul>\n<h2>2. Undoing changes with Rebase<\/h2>\n<h3>2.1 Interactive Mode<\/h3>\n<p>Another way to undo changes is through <code>git rebase<\/code> interactive mode.<\/p>\n<pre class=\"brush:bash\">git rebase -i HEAD~7\n<\/pre>\n<p>Terminal will display all the commits in <code>aster<\/code>&nbsp;branch.<\/p>\n<pre class=\"brush:bash\">pick 058fb9c Update to M1\npick a2dd100 Update to M2\npick 351fe18 Update to M3\npick afeee89 Update to M4\npick 22d157d Update to M5\npick 17222ce Update to RC1\npick 16594ba Update to RELEASE\n<\/pre>\n<p>Now, we can delete line by line and then will&nbsp;be deleted from the git&#8217;s log history too. We will delete the first 6 commits.<\/p>\n<pre class=\"brush:bash\">pick 16594ba Update to RELEASE<\/pre>\n<p>Resolve the conflict:<\/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\" 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\n &lt;groupId&gt;io.eddumelendez&lt;\/groupId&gt;\n &lt;artifactId&gt;git-remove-commit-example&lt;\/artifactId&gt;\n &lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;\n &lt;packaging&gt;jar&lt;\/packaging&gt;\n\n &lt;name&gt;git-remove-commit-example&lt;\/name&gt;\n &lt;description&gt;Demo project for Spring Boot&lt;\/description&gt;\n\n &lt;parent&gt;\n &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n &lt;artifactId&gt;spring-boot-starter-parent&lt;\/artifactId&gt;\n&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD\n &lt;version&gt;1.3.0.BUILD-SNAPSHOT&lt;\/version&gt;\n=======\n &lt;version&gt;1.3.0.RELEASE&lt;\/version&gt;\n&gt;&gt;&gt;&gt;&gt;&gt;&gt; 16594ba... Update to RELEASE\n &lt;relativePath\/&gt; &lt;!-- lookup parent from repository --&gt;\n &lt;\/parent&gt;\n\n &lt;properties&gt;\n &lt;project.build.sourceEncoding&gt;UTF-8&lt;\/project.build.sourceEncoding&gt;\n &lt;java.version&gt;1.8&lt;\/java.version&gt;\n &lt;\/properties&gt;\n\n &lt;dependencies&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n &lt;artifactId&gt;spring-boot-starter-web&lt;\/artifactId&gt;\n &lt;\/dependency&gt;\n\n &lt;dependency&gt;\n &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n &lt;artifactId&gt;spring-boot-starter-test&lt;\/artifactId&gt;\n &lt;scope&gt;test&lt;\/scope&gt;\n &lt;\/dependency&gt;\n &lt;\/dependencies&gt;\n\n &lt;build&gt;\n &lt;plugins&gt;\n &lt;plugin&gt;\n &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n &lt;artifactId&gt;spring-boot-maven-plugin&lt;\/artifactId&gt;\n &lt;\/plugin&gt;\n &lt;\/plugins&gt;\n &lt;\/build&gt;\n\n&lt;\/project&gt;<\/pre>\n<p>After conflicts resolution you can perform the following command.[ulp id=&#8217;pzgfvmZhgslwSymm&#8217;]<\/p>\n<pre class=\"brush:bash\">git add .<\/pre>\n<p>Now, proceed with the <code>rebase<\/code>.<\/p>\n<pre class=\"brush:bash\">git rebase --continue<\/pre>\n<p>Perform the following command <code>git log --oneline --graph --decorate<\/code>. Then as you can see commits between the first and the last commit have been deleted.<\/p>\n<pre class=\"brush:bash\">6b91ba6 (HEAD -&gt; master) Update to RELEASE\n6a93b1b Initial commit\n<\/pre>\n<h3>2.2. Onto<\/h3>\n<p>This time we will perform commits deletion in a single command using <code>git rebase --onto<\/code>. Similar to the example above we will remove commits between the first and the last commit.<\/p>\n<pre class=\"brush:bash\">git rebase --onto HEAD~7 HEAD~1 master<\/pre>\n<p>Perform the following command <code>git log --oneline --graph --decorate<\/code>. Then as you can see commits between the first and the last commit have been deleted.<\/p>\n<pre class=\"brush:bash\">bf9340f (HEAD -&gt; master) Update to RELEASE\n6a93b1b Initial commit\n<\/pre>\n<h2>3. Conclusion<\/h2>\n<p>As we can see, in this example we have learnt how to remove commits in different ways using following commands <code>reset<\/code>, <code>rebase<\/code> and more options with each one. Take care when you are removing commits in order to avoid conflicts with your teammates.<\/p>\n<h2>4. 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=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/git-remove-commit-example.zip\"><strong>GitRemoveCommitExample.zip<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this example, we shall show how to remove commits from our git&#8217;s log history. As we can see, we can commit every time we want because these commits will persist in our local machine and nobody can access to them if push have not been performed to the git central repository. Commit every change &hellip;<\/p>\n","protected":false},"author":58,"featured_media":27377,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1353],"tags":[1203],"class_list":["post-28402","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-git","tag-git"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Git Remove Commit Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"In this example, we shall show how to remove commits from our git&#039;s log history. As we can see, we can commit every time we want because these commits\" \/>\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\/software-development\/git\/git-remove-commit-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git Remove Commit Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"In this example, we shall show how to remove commits from our git&#039;s log history. As we can see, we can commit every time we want because these commits\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-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:published_time\" content=\"2015-11-20T09:00:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-23T11:55:34+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=\"Eddu Melendez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@eddumelendez\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Eddu Melendez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/\"},\"author\":{\"name\":\"Eddu Melendez\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/5f3392b0e6e58390b9565c8ca1680a69\"},\"headline\":\"Git Remove Commit Example\",\"datePublished\":\"2015-11-20T09:00:54+00:00\",\"dateModified\":\"2019-04-23T11:55:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/\"},\"wordCount\":515,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"keywords\":[\"git\"],\"articleSection\":[\"Git\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/\",\"name\":\"Git Remove Commit Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg\",\"datePublished\":\"2015-11-20T09:00:54+00:00\",\"dateModified\":\"2019-04-23T11:55:34+00:00\",\"description\":\"In this example, we shall show how to remove commits from our git's log history. As we can see, we can commit every time we want because these commits\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-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\/software-development\/git\/git-remove-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 Remove 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\/5f3392b0e6e58390b9565c8ca1680a69\",\"name\":\"Eddu Melendez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/08\/Eddu-Melendez-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/08\/Eddu-Melendez-96x96.jpg\",\"caption\":\"Eddu Melendez\"},\"description\":\"Eddu is a Peruvian software engineer. He is interested in Java, Spring Framework and Mule ESB. He is also very enthusiastic to learn new stuff.\",\"sameAs\":[\"http:\/\/eddumelendez.github.io\/\",\"https:\/\/pe.linkedin.com\/in\/eddumelendez\",\"https:\/\/x.com\/eddumelendez\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/eddu-melendez\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Git Remove Commit Example - Java Code Geeks","description":"In this example, we shall show how to remove commits from our git's log history. As we can see, we can commit every time we want because these commits","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\/software-development\/git\/git-remove-commit-example\/","og_locale":"en_US","og_type":"article","og_title":"Git Remove Commit Example - Java Code Geeks","og_description":"In this example, we shall show how to remove commits from our git's log history. As we can see, we can commit every time we want because these commits","og_url":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2015-11-20T09:00:54+00:00","article_modified_time":"2019-04-23T11:55:34+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":"Eddu Melendez","twitter_card":"summary_large_image","twitter_creator":"@eddumelendez","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Eddu Melendez","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/"},"author":{"name":"Eddu Melendez","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/5f3392b0e6e58390b9565c8ca1680a69"},"headline":"Git Remove Commit Example","datePublished":"2015-11-20T09:00:54+00:00","dateModified":"2019-04-23T11:55:34+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/"},"wordCount":515,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","keywords":["git"],"articleSection":["Git"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/","url":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/","name":"Git Remove Commit Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/09\/git-logo.jpg","datePublished":"2015-11-20T09:00:54+00:00","dateModified":"2019-04-23T11:55:34+00:00","description":"In this example, we shall show how to remove commits from our git's log history. As we can see, we can commit every time we want because these commits","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-commit-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/software-development\/git\/git-remove-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\/software-development\/git\/git-remove-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 Remove 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\/5f3392b0e6e58390b9565c8ca1680a69","name":"Eddu Melendez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/08\/Eddu-Melendez-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/08\/Eddu-Melendez-96x96.jpg","caption":"Eddu Melendez"},"description":"Eddu is a Peruvian software engineer. He is interested in Java, Spring Framework and Mule ESB. He is also very enthusiastic to learn new stuff.","sameAs":["http:\/\/eddumelendez.github.io\/","https:\/\/pe.linkedin.com\/in\/eddumelendez","https:\/\/x.com\/eddumelendez"],"url":"https:\/\/examples.javacodegeeks.com\/author\/eddu-melendez\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/28402","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\/58"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=28402"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/28402\/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=28402"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=28402"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=28402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}