Using the Reflog to Restore Lost Commits<\/a><\/li><\/ol>\n\n\n\n<\/p>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"
A commit can be something that helps us stay on top of things. It can be a container for related changes that belong to one and only one topic, and thereby make it easier for us to understand what happened.<\/p>\n
In this post, we\u2019re talking about what it takes to produce the “perfect” commit.<\/p>\n","protected":false},"author":247217,"featured_media":352478,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"c2c_always_allow_admin_comments":false,"footnotes":"","jetpack_publicize_message":"First article in an ongoing series by @gntr on using Git: Creating the Perfect Commit","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":[]},"categories":[4],"tags":[767,766,1038],"jetpack_publicize_connections":[],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/09\/better-commits.png?fit=1072%2C601&ssl=1","jetpack-related-posts":[{"id":356700,"url":"https:\/\/css-tricks.com\/cherry-picking-commits-in-git\/","url_meta":{"origin":352475,"position":0},"title":"Cherry-Picking Commits in Git","date":"November 17, 2021","format":false,"excerpt":"In part 5 of this series, we looked at rebasing and merging. Although there are a couple of differences between git merge and git rebase, both commands have the same goal: they integrate changes from one branch into another.","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/11\/git-cherry-picking.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":357728,"url":"https:\/\/css-tricks.com\/using-the-reflog-to-restore-lost-commits\/","url_meta":{"origin":352475,"position":1},"title":"Using the Reflog to Restore Lost Commits","date":"November 30, 2021","format":false,"excerpt":"This article is part of our \u201cAdvanced Git\u201d series. Be sure to follow us on Twitter or sign up for our newsletter to hear about future articles! The \u201cReflog\u201d is one of Git\u2019s lesser-known features\u2014but one that can be extremely helpful. Some people refer to it as a \u201csafety net,\u201d\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/11\/pasted-image-0-2.png?fit=1200%2C438&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":281934,"url":"https:\/\/css-tricks.com\/the-smart-ways-to-correct-mistakes-in-git\/","url_meta":{"origin":352475,"position":2},"title":"The Smart Ways to Correct Mistakes in Git","date":"February 13, 2019","format":false,"excerpt":"The world of software development offers an infinite amount of ways to mess up: deleting the wrong things, coding into dead ends, littering commit messages with typos, are a mere few of the plentitude. \u200b\u200b \u200b\u200bFortunately, however, we have a wonderful safety net under our feet in the form of\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2019\/02\/git-pattern.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":355658,"url":"https:\/\/css-tricks.com\/interactive-rebase-clean-up-your-commit-history\/","url_meta":{"origin":352475,"position":3},"title":"Interactive Rebase: Clean up your Commit History","date":"November 12, 2021","format":false,"excerpt":"Interactive Rebase is the Swiss Army knife of Git commands: lots of use cases and lots of possibilities! It's really a great addition to any developer's tool chain, because it lets you revise your local commit history\u2014before you share your work with the rest of the team. Let's see what\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/11\/interactive-rebase_reword_CLI.gif?fit=700%2C370&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":175076,"url":"https:\/\/css-tricks.com\/sponsored-tower-2-0-make-git-easy\/","url_meta":{"origin":352475,"position":4},"title":"Tower 2.0 is Here – To Make Git Easy!","date":"July 24, 2014","format":false,"excerpt":"Most people wouldn't call version control their hobby. But in the last few years, people have also become aware of how valuable it is. Nowadays, you won't find a top programmer, web developer, or web designer who doesn't use version control. In part because it helps you produce better results\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":360998,"url":"https:\/\/css-tricks.com\/git-switching-unstaged-changes-to-a-new-branch\/","url_meta":{"origin":352475,"position":5},"title":"Git: Switching Unstaged Changes to a New Branch","date":"January 27, 2022","format":false,"excerpt":"I'm always on the wrong branch. I'm either on master or main working on something that should be on a fix or feature branch. Or I'm on the last branch I was working on and should have cut a new branch. Oh well. It's never that big of a deal.\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2022\/01\/git-switch.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]}],"featured_media_src_url":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/09\/better-commits.png?fit=1024%2C574&ssl=1","_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/352475"}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/247217"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=352475"}],"version-history":[{"count":10,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/352475\/revisions"}],"predecessor-version":[{"id":358346,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/352475\/revisions\/358346"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media\/352478"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=352475"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/categories?post=352475"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=352475"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}