{"id":82,"date":"2015-10-07T12:09:17","date_gmt":"2015-10-07T01:09:17","guid":{"rendered":"http:\/\/madlid.com\/madlid\/?p=82"},"modified":"2015-10-07T12:09:17","modified_gmt":"2015-10-07T01:09:17","slug":"reverting-to-a-previous-version-of-a-file-using-git","status":"publish","type":"post","link":"https:\/\/madlid.com\/madlid\/2015\/10\/07\/reverting-to-a-previous-version-of-a-file-using-git\/","title":{"rendered":"Reverting to a previous version of a file using git"},"content":{"rendered":"<p>View list of versions for a file:<\/p>\n<pre>git log main.m<\/pre>\n<p>This will display a list of commits for that file:<\/p>\n<pre>commit d689ccce47c51a478550609db124afe2940a0a21\r\nAuthor: Martyn Davis &lt;mad@madlid.com&gt;\r\nDate: \u00a0 Mon Oct 5 14:02:56 2015 +1100\r\n\u00a0 \u00a0 Some changes\r\ncommit 9f0c61426043e3323365e89b2b1a08c3282cce6b\r\nAuthor: Martyn Davis &lt;mad@madlid.com&gt;\r\nDate: \u00a0 Mon Oct 5 07:47:41 2015 +1100\r\n\u00a0 \u00a0 First working version<\/pre>\n<p>To revert back to the first commit of main.m:<\/p>\n<pre>git checkout\u00a09f0c61426043e3323365e89b2b1a08c3282cce6b main.m<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>View list of versions for a file: git log main.m This will display a list of commits for that file: commit d689ccce47c51a478550609db124afe2940a0a21 Author: Martyn Davis &lt;mad@madlid.com&gt; Date: \u00a0 Mon Oct 5 14:02:56 2015 +1100 \u00a0 \u00a0 Some changes commit 9f0c61426043e3323365e89b2b1a08c3282cce6b Author: Martyn Davis &lt;mad@madlid.com&gt; Date: \u00a0 Mon Oct 5 07:47:41 2015 +1100 \u00a0 \u00a0 First &hellip; <a href=\"https:\/\/madlid.com\/madlid\/2015\/10\/07\/reverting-to-a-previous-version-of-a-file-using-git\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Reverting to a previous version of a file using git<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-82","post","type-post","status-publish","format-standard","hentry","category-development","category-git"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/madlid.com\/madlid\/wp-json\/wp\/v2\/posts\/82","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/madlid.com\/madlid\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/madlid.com\/madlid\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/madlid.com\/madlid\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/madlid.com\/madlid\/wp-json\/wp\/v2\/comments?post=82"}],"version-history":[{"count":1,"href":"https:\/\/madlid.com\/madlid\/wp-json\/wp\/v2\/posts\/82\/revisions"}],"predecessor-version":[{"id":83,"href":"https:\/\/madlid.com\/madlid\/wp-json\/wp\/v2\/posts\/82\/revisions\/83"}],"wp:attachment":[{"href":"https:\/\/madlid.com\/madlid\/wp-json\/wp\/v2\/media?parent=82"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/madlid.com\/madlid\/wp-json\/wp\/v2\/categories?post=82"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/madlid.com\/madlid\/wp-json\/wp\/v2\/tags?post=82"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}