git ある特定の commit のみ取り消す。
例えばgit logでこんな感じのとき
update jsだけを取り消したい。
Author: Junichi Otake <@gmail.com>
Date: Mon May 27 15:22:06 2013 +0900
delete new items !
commit d5d366f6a9be5a9a0657231b048f206ccd0fd72d
Author: Junichi Otake <@gmail.com>
Date: Thu May 23 14:56:59 2013 +0900
update js
commit ae27735597e927982d39c95e7d49244c8335bcd7
Author: Junichi Otake
Date: Wed May 22 18:41:21 2013 +0900
add promoteBabyGrowth
ログの詳細を確認
git log –stat で変更ファイルを確認
Author: Junichi Otake <@gmail.com>
Date: Thu May 23 14:56:59 2013 +0900
update js
scripts/manage/check_user.php | 9 +++-
web/sp/js/game_mid.js | 141 +++++++++++++++++++++++++++++++++++++—-
web/sp/js/game_prod.js | 118 ++++++++++++++++++—————-
3 files changed, 199 insertions(+), 69 deletions(-)
commit ae27735597e927982d39c95e7d49244c8335bcd7
update js以降に別の更新をしているならマージなどが必要
とりあえず、下のcommitのハッシュまで対象ファイルを戻すだけで良い場合は
git diff ae27735597e927982d39c95e7d49244c8335bcd7 web/sp/js/game_mid.js
で変更点を確認して問題なければ
git reset ae27735597e927982d39c95e7d49244c8335bcd7 web/sp/js/game_mid.js
git diff でまた変更を確認して問題なければ add して commit