LoginSignup
0
0

More than 3 years have passed since last update.

【Git】ステージングから取り消したい。

Posted at

git addしたけど、取り消したいときに

git addをして、ステージングに登録したけどやっぱり取り消したいとき。

$ git reset HEAD index.html

これで、git addでステージングに登録したものを取り消すことができる。
ただ、変更自体が取り消されるわけではない。
もし、変更後と取り消したい場合は以下のコマンドを実行する。

$ git reset HEAD .

これで、ファイルそのものの変更も取り消される。

0
0
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
0
0