From: "Santi Béjar" <sbejar@gmail.com>
To: "Ping Yin" <pkufranky@gmail.com>
Cc: "Git Mailing List" <git@vger.kernel.org>
Subject: Re: [RFC] git reset --recover
Date: Mon, 3 Mar 2008 16:13:06 +0100 [thread overview]
Message-ID: <8aa486160803030713r7bdcf825sf994cbb20f096ccd@mail.gmail.com> (raw)
In-Reply-To: <46dff0320803030659j2fa0325lf9c88b915ddb70da@mail.gmail.com>
On Mon, Mar 3, 2008 at 3:59 PM, Ping Yin <pkufranky@gmail.com> wrote:
> 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!
"git reset" was sufficient.
>
> So, can we introduce a --recover option for "git reset" to save the
> foolish or careless people like me?
Another possibility would be to not delete a file that is absent in
both the old and new HEAD, even if it was in the index.
Santi
next prev parent reply other threads:[~2008-03-03 15:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-03 14:59 [RFC] git reset --recover Ping Yin
2008-03-03 15:13 ` Santi Béjar [this message]
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=8aa486160803030713r7bdcf825sf994cbb20f096ccd@mail.gmail.com \
--to=sbejar@gmail.com \
--cc=git@vger.kernel.org \
--cc=pkufranky@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.
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).