From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manish Subject: Re: Novice questions about using git for personal data files Date: Fri, 23 Jan 2009 19:43:39 +0530 Message-ID: References: <7bef1f890901230355l601c112fi3ecf0f22b15ffdfe@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LQMn4-000594-JS for emacs-orgmode@gnu.org; Fri, 23 Jan 2009 09:13:46 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LQMn1-00057q-Lt for emacs-orgmode@gnu.org; Fri, 23 Jan 2009 09:13:45 -0500 Received: from [199.232.76.173] (port=41888 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQMn1-00057W-10 for emacs-orgmode@gnu.org; Fri, 23 Jan 2009 09:13:43 -0500 Received: from ti-out-0910.google.com ([209.85.142.185]:65069) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LQMn0-0000Vo-HL for emacs-orgmode@gnu.org; Fri, 23 Jan 2009 09:13:42 -0500 Received: by ti-out-0910.google.com with SMTP id u5so3266579tia.10 for ; Fri, 23 Jan 2009 06:13:39 -0800 (PST) In-Reply-To: <7bef1f890901230355l601c112fi3ecf0f22b15ffdfe@mail.gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Alan E. Davis" Cc: emacs-orgmode Mailinglist On Fri, Jan 23, 2009 at 5:25 PM, Alan E. Davis wrote: > I followed the steps outlined in the worg tutorial about using git to keep > track of changes to one's own org data tree. > > I still don't understand: how does one go about recovering an earlier > version of a file that has been corrupted? Is there a good tutorial on this > aspect of using git? I am not aware of any tutorial on this but may following should help. 1. Do a "git log" in the repo to see what commits you have made 2. Decide from which commit you want to revive the file (most likely it would be the top most one.) 3. Note down the SHA1 for this commit (first eight or so characters should suffice.) 4. Following should get you the file: $ git checkout 5. You may need to add and commit the file back again to your git repo. Frequent commits is a good idea but it's a burden so you might want to create a small shell-script to commit periodically (hourly or so maybe) for you. Do let us know how it goes. HTH -- Manish