{"id":311,"date":"2018-11-15T20:56:02","date_gmt":"2018-11-15T20:56:02","guid":{"rendered":"http:\/\/www.evermoretechnologies.com\/blog\/?p=311"},"modified":"2018-11-15T20:56:17","modified_gmt":"2018-11-15T20:56:17","slug":"how-to-remove-files-staged-for-commit-from-git-add","status":"publish","type":"post","link":"https:\/\/www.evermoretechnologies.com\/blog\/2018\/11\/how-to-remove-files-staged-for-commit-from-git-add\/","title":{"rendered":"How to remove files staged for commit from git add"},"content":{"rendered":"<p>If you accidentally add files to a commit, it&#8217;s easy to remove them through the cli.<\/p>\n<p>To remove one file:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">git reset imageidontwant.jpg<\/pre>\n<p>&nbsp;<\/p>\n<p>To reset all added files.\u00a0 (You&#8217;ll have to re-add the files you actually want to add to the commit.)\u00a0 Simply type<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">git reset<\/pre>\n<p>&nbsp;<\/p>\n<p>That will unstage any files.\u00a0 It will not undo commits.\u00a0 That&#8217;s a more complicated process.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you accidentally add files to a commit, it&#8217;s easy to remove them through the cli. To remove one file: git reset imageidontwant.jpg &nbsp; To reset all added files.\u00a0 (You&#8217;ll&#8230; <a href=\"https:\/\/www.evermoretechnologies.com\/blog\/2018\/11\/how-to-remove-files-staged-for-commit-from-git-add\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[38],"tags":[],"_links":{"self":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/311"}],"collection":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/comments?post=311"}],"version-history":[{"count":2,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/311\/revisions"}],"predecessor-version":[{"id":313,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/311\/revisions\/313"}],"wp:attachment":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}