LoginSignup
0
0

More than 5 years have passed since last update.

git取り消しのメモ

Posted at

間違ってステージングにあげてしまった!(ターミナル操作で全部 git add .みたいなの)

個人的解釈メモ
git resetgit addしちゃったもの=ステージングにあげた操作を取りやめしたい的な
(ステージングにあがっているものを取り消す)

操作

addしたファイルを取りやめ
git rest path名

例)
src/components/user.jsを間違ってあげてしまった!場合は
git reset src/components/users.jsとやる

全て取りやめしたい(git add.しちゃったものを全てステージングからさげる)

git reset HEAD (HEADは小文字でもいける)
addをまるっと取り消す※HEADは省略可能みたい※

$ git reset HEAD
この操作はgit addしたものを取りやめるだけなので、変更点に関してはそのまま残る

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