LoginSignup
49
42

More than 5 years have passed since last update.

Gitで間違って消したファイルやディレクトリを復活させたい

Last updated at Posted at 2014-04-26

git checkout -f する。変更も一緒に戻るので注意。

$ git checkout -f

一部だけ戻したい時はパス名を指定する。

$ git checkout -f Gemfile

後で今の状態に戻す可能性がある時はgit stashの方がいいかもしれない。


$ git stash

# 戻す
$ git stash pop
49
42
2

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
49
42