Git-fu

Problems Reverting anything that has been done Imagine you’ve made several commits, but then you run git reset --hard HEAD~2 and lose the last two commits. You can restore them as follows: Check reflog log git reflog The output might show: c4f2a27 (HEAD -> main) HEAD@{0}: reset: moving to HEAD~2 a3d5b8e HEAD@{1}: commit: Menambahkan file README You want to restore commit a3d5b8e: git reset --hard a3d5b8e To restore, you can use ...

May 26, 2024 · 5 min · I Dewa Putu Ardi Nusawan