0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

直前のgit commitを削除するには

0
Last updated at Posted at 2018-07-05

Githubに誤ったcommitをpushしてしまったので、
git rebaseで戻したいcommitまでさかのぼり
禁じ手git push -fで強制pushで解決したので備忘録。

C:\Users\folder>git rebase -i [xxxxxxx] #ハッシュ値でコミットを指定
C:\Users\folder>git push -f
Total 0 (delta 0), reused 0 (delta 0)
To github.com:MyRepository
 + [yyyyyyy]...[xxxxxxx] master -> master (forced update)

C:\Users\folder>

今回は直前のコミットが削除対象だったのでこれで解決しましたが、
git push -fがそもそも危険なやり方なんだろうなぁ…と。^^;

参考サイト

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?