{"id":1006,"date":"2021-11-01T22:37:49","date_gmt":"2021-11-01T20:37:49","guid":{"rendered":"https:\/\/www.codefraction.com\/?p=1006"},"modified":"2021-11-01T22:38:44","modified_gmt":"2021-11-01T20:38:44","slug":"how-to-install-unity-game-engine-and-rider-ide-in-pop-os-ubuntu-2","status":"publish","type":"post","link":"https:\/\/www.codefraction.com\/index.php\/2021\/11\/01\/how-to-install-unity-game-engine-and-rider-ide-in-pop-os-ubuntu-2\/","title":{"rendered":"Recover a Lost  or Missing Commit in Git"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"1006\" class=\"elementor elementor-1006\" data-elementor-settings=\"{&quot;ha_cmc_init_switcher&quot;:&quot;no&quot;}\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-22b84131 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"22b84131\" data-element_type=\"section\" data-settings=\"{&quot;_ha_eqh_enable&quot;:false}\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-narrow\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-4478757\" data-id=\"4478757\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-0421967 elementor-widget elementor-widget-theme-post-title elementor-page-title elementor-widget-heading\" data-id=\"0421967\" data-element_type=\"widget\" data-widget_type=\"theme-post-title.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h1 class=\"elementor-heading-title elementor-size-default\">Recover a Lost  or Missing Commit in Git<\/h1>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f311992 elementor-align-left elementor-widget elementor-widget-global elementor-global-471 elementor-widget-post-info\" data-id=\"f311992\" data-element_type=\"widget\" data-widget_type=\"post-info.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<ul class=\"elementor-inline-items elementor-icon-list-items elementor-post-info\">\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item elementor-repeater-item-a9d1b46 elementor-inline-item\" itemprop=\"datePublished\">\n\t\t\t\t\t\t<a href=\"https:\/\/www.codefraction.com\/index.php\/2021\/11\/01\/\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t\t<i aria-hidden=\"true\" class=\"fas fa-calendar\"><\/i>\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text elementor-post-info__item elementor-post-info__item--type-date\">\n\t\t\t\t\t\t\t\t\t\t<time>November 1, 2021<\/time>\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t<\/li>\n\t\t\t\t<li class=\"elementor-icon-list-item elementor-repeater-item-8fee4f0 elementor-inline-item\" itemprop=\"about\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t\t<i aria-hidden=\"true\" class=\"fas fa-tags\"><\/i>\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text elementor-post-info__item elementor-post-info__item--type-terms\">\n\t\t\t\t\t\t\t<span class=\"elementor-post-info__item-prefix\">Tags: <\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-post-info__terms-list\">\n\t\t\t\t<a href=\"https:\/\/www.codefraction.com\/index.php\/tag\/game-development\/\" class=\"elementor-post-info__terms-list-item\">Game Development<\/a>, <a href=\"https:\/\/www.codefraction.com\/index.php\/tag\/git\/\" class=\"elementor-post-info__terms-list-item\">Git<\/a>\t\t\t\t<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t<\/ul>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b82449d elementor-widget elementor-widget-text-editor\" data-id=\"b82449d\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>If you have ever lost a commit in Git, don&#8217;t worry there might be still a chance to recover it. For example I encountered a problem with Git, when I was pushing my commit to the remote server. For some reason my Git client had some error when sending the commit to the remote server. So the commit didn&#8217;t go through and the Git client deleted all my local modifications from my local machine. So I couldn&#8217;t try to send the commit again (as Git said there&#8217;s no modifications \/ commit to send). Basically it reset all my files to the state that they were when I last time made a successful commit to the server. Fortunately I found a way to dig up the lost commit and modifications that I have made with git reflog. Go inside your project folder, and then run the following:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-46f6f81 elementor-widget elementor-widget-text-editor\" data-id=\"46f6f81\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<div><pre>git reflog<\/pre><\/div>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-11bb355 elementor-widget elementor-widget-text-editor\" data-id=\"11bb355\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Now you should see a log of what has happened in your local repository. Every action that you have taken in your local repository (in your your local computer) should have an ID and what kind of action is it. So for example I found my lost commit few rows below in the log. The lost commit is in a form of &#8220;db123456 HEAD commit: your commit message&#8221;. Write down the ID string (in my example it&#8217;s the 8 characters long string &#8220;db123456&#8221;). Before we try to recover the lost commit, you should backup your project folder just in case, if something goes wrong or you need to try recovering again.<\/p><p>\u00a0<\/p><p>We will next reset the local git repository. Remember it will delete any modifications that you have made after the lost commit. So if you have multiple missing commits, then you should maybe try to recover them one by one. That&#8217;s why I recommend backup your project folder before recovering. To get back your missing commit, run the following command (remember to replace the ID with your ID that you have written down):<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-34587a7 elementor-widget elementor-widget-text-editor\" data-id=\"34587a7\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<div>\n<pre>git reset --hard db123456<\/pre>\n<\/div>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-150b3a0 elementor-widget elementor-widget-text-editor\" data-id=\"150b3a0\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Now hopefully you should have recovered your lost commit.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-98c0ff6 elementor-widget elementor-widget-spacer\" data-id=\"98c0ff6\" data-element_type=\"widget\" data-widget_type=\"spacer.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-spacer\">\n\t\t\t<div class=\"elementor-spacer-inner\"><\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-760913c elementor-widget elementor-widget-heading\" data-id=\"760913c\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Sources:<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-bef651b elementor-widget elementor-widget-text-editor\" data-id=\"bef651b\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><a href=\"https:\/\/stackoverflow.com\/questions\/10099258\/how-can-i-recover-a-lost-commit-in-git\">https:\/\/stackoverflow.com\/questions\/10099258\/how-can-i-recover-a-lost-commit-in-git<\/a><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1c24402 elementor-widget elementor-widget-spacer\" data-id=\"1c24402\" data-element_type=\"widget\" data-widget_type=\"spacer.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-spacer\">\n\t\t\t<div class=\"elementor-spacer-inner\"><\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>If you have ever lost a commit in Git, don't worry there might be still a chance to recover it. For example I encountered a problem with Git, when I was pushing my commit to the remote server. For some reason my Git client had some error when sending the commit to the remote server. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"elementor_header_footer","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[29,34],"class_list":["post-1006","post","type-post","status-publish","format-standard","hentry","category-git","tag-game-development","tag-git"],"_links":{"self":[{"href":"https:\/\/www.codefraction.com\/index.php\/wp-json\/wp\/v2\/posts\/1006","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codefraction.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codefraction.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codefraction.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codefraction.com\/index.php\/wp-json\/wp\/v2\/comments?post=1006"}],"version-history":[{"count":20,"href":"https:\/\/www.codefraction.com\/index.php\/wp-json\/wp\/v2\/posts\/1006\/revisions"}],"predecessor-version":[{"id":1129,"href":"https:\/\/www.codefraction.com\/index.php\/wp-json\/wp\/v2\/posts\/1006\/revisions\/1129"}],"wp:attachment":[{"href":"https:\/\/www.codefraction.com\/index.php\/wp-json\/wp\/v2\/media?parent=1006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codefraction.com\/index.php\/wp-json\/wp\/v2\/categories?post=1006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codefraction.com\/index.php\/wp-json\/wp\/v2\/tags?post=1006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}