git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ping Yin" <pkufranky@gmail.com>
To: "Git Mailing List" <git@vger.kernel.org>
Subject: [RFC] git reset --recover
Date: Mon, 3 Mar 2008 22:59:14 +0800	[thread overview]
Message-ID: <46dff0320803030659j2fa0325lf9c88b915ddb70da@mail.gmail.com> (raw)

Today i use git reset carelessly and lose all my changes!

To remind other people not do the same wrong thing, i share my
experience and propose a new option to avoid this happens again.
------------------------------------
foo
   .git
    bar
        file1
        file2
------------------------------------

In the direcotry structure above, i want to make bar as a repository
(which hasn't yet been tracked by foo repository). I should have done
this as follows

-------------------------------------------
cd bar
git init
git add
------------------------------------------

but i fogot to type "git init" which results that file1 and file2 are
added to index of foo repository. I tried to revert the operation
using "git reset". And the tragedy happened at that time because i
made so fatal  a mistake that i typed "git reset --hard". And i lost
all my files in bar dir!

So, can we introduce a --recover option for "git reset" to save the
foolish or careless people like me?

-- 
Ping Yin

             reply	other threads:[~2008-03-03 14:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-03 14:59 Ping Yin [this message]
2008-03-03 15:13 ` [RFC] git reset --recover Santi Béjar
2008-03-03 16:47   ` Ping Yin
2008-03-03 17:02 ` Charles Bailey
2008-03-04  5:21   ` Ping Yin
2008-03-04  7:42     ` Jay Soffian
2008-03-04  8:22       ` Ping Yin

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

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

  git send-email \
    --in-reply-to=46dff0320803030659j2fa0325lf9c88b915ddb70da@mail.gmail.com \
    --to=pkufranky@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
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 NNTP newsgroup(s).