LoginSignup
7
7

More than 5 years have passed since last update.

git: 特定のディレクトリだけあるバージョンに戻したい

Posted at

push済みの特定のディレクトリだけあるバージョンに戻す方法です。gitの技で戻せる方法があるのでしょうが、愚直なやり方です。

あるバージョンにリセットする。全体がリセットされる。

git reset <version>

特定のディレクトリを退避する。

cp -R target-dir ~/Desktop/target-dir

全体のバージョンを元に戻す。

git pull

特定のディレクトリも最新に戻るので削除する。

rm -rf target-dir

退避したディレクトリを持ってくる。

cp -R ~/Desktop/target-dir .
7
7
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
7
7