“Kembali ke Commit di Git” Kode Jawaban

Roll Back Last Commit di Git

git reset --soft HEAD~1
Lucky Lapwing

Kembalikan komit terakhir

$ git reset --soft HEAD~1
Brainy Butterfly

Kembalikan komit terakhir

git reset HEAD~ 
imaskm

Kembali ke Commit di Git

git reset --hard HEAD
Wicked Wolf

git kembali ke komit terakhir

git log
    commit 101: bad commit    # Latest commit. This would be called 'HEAD'.
    commit 100: good commit   # Second to last commit. This is the one we want.
To restore everything back to the way it was prior to the last commit, we need to reset to the commit before HEAD:

git reset --soft HEAD^     # Use --soft if you want to keep your changes
git reset --hard HEAD^     # Use --hard if you don't care about keeping the changes you made
Clear Copperhead

Bagaimana cara kembali ke Git Commit terakhir

git checkout . #This will get rid of all uncommited change
BuhtanDingDing

Jawaban yang mirip dengan “Kembali ke Commit di Git”

Pertanyaan yang mirip dengan “Kembali ke Commit di Git”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya