How to "reopen" git commit?

(Notice I'm not looking for an answer git rebase -i)

In mercurial, I can re-open the commit by importing it into the patch queue:

hg qimport tip

The end is "open" in the sense that, just as before I completed it, I can return, do it hg diff, hg statusetc. How to do this in git?

(Everything I found on the Internet offers git rebase -i, and then select edit, but this is different because commit is not "open" in the same way.)

+5
source share
4 answers

You just need to move the HEAD pointer without making any changes to the working copy:

git reset --soft HEAD^

Reset , soft , - . , reset , .

HEAD - "" git, (.. ). (^) . , . HEAD ^^ .

+16

, , git reset --soft HEAD^ " " .

+2

, git commit --amend.

. Hg Git.

+2
Scott Chacon (wonderfully) developed the git reset team: http://progit.org/2011/07/11/reset.html Feel free to look at that.
+1
source

All Articles