Referencing the child of a commit in Git

后端 未结 10 1135
失恋的感觉
失恋的感觉 2020-11-28 08:37

If you want to move the HEAD to the parent of the current HEAD, that\'s easy:

git reset --hard HEAD^

But is there

10条回答
  •  伪装坚强ぢ
    2020-11-28 09:11

    You can use gitk ... since there can be more than one child there is probably no easy way like HEAD^.

    If you want to undo your whole operation you can use the reflog, too. Use git reflog to find your commit’s pointer, which you can use for the reset command. See here.

提交回复
热议问题