LoginSignup
17
17

More than 5 years have passed since last update.

Gitで間違えてaddしてしかもcommitしてしまったファイルを取り消す

Last updated at Posted at 2012-02-10

例えば2つ前のコミットに対して行う場合。

> git rebase -i HEAD~2
> git reset HEAD~2 -- path/to/file
> git commit --amend
> git stash save
> git rebase --continue
> git stash pop

Gitは使い始めて1年以上経つがいまいち使いこなせている感じがしない。

17
17
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
17