emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Manish <mailtomanish.sharma@gmail.com>
To: "Alan E. Davis" <lngndvs@gmail.com>
Cc: emacs-orgmode Mailinglist <emacs-orgmode@gnu.org>
Subject: Re: Novice questions about using git for personal data files
Date: Fri, 23 Jan 2009 19:43:39 +0530	[thread overview]
Message-ID: <e7cdbe30901230613t5e3bc055pba3a481a03b2d39f@mail.gmail.com> (raw)
In-Reply-To: <7bef1f890901230355l601c112fi3ecf0f22b15ffdfe@mail.gmail.com>

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 <SHA1> <file to 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

      reply	other threads:[~2009-01-23 14:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-23 11:55 Novice questions about using git for personal data files Alan E. Davis
2009-01-23 14:13 ` Manish [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e7cdbe30901230613t5e3bc055pba3a481a03b2d39f@mail.gmail.com \
    --to=mailtomanish.sharma@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=lngndvs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).