是否有可能从从git reflog收到的数据中恢复git提交?
git reflog输出示例。
eff9143 HEAD@{14}: merge develop: Fast-forward
e3ad8f7 HEAD@{15}: checkout: moving from develop to master
eff9143 HEAD@{16}: commit: Add Login view. Setting up project structure.
e3ad8f7 HEAD@{17}: checkout: moving from master to develop
e3ad8f7 HEAD@{18}: commit: Add LaunchScreen发布于 2017-02-05 04:04:29
当然了。
点击此处阅读所有相关信息:How to move HEAD back to a previous location? (Detached head)
您可以做的是创建新的分支或将当前分支重置为所需的提交,然后对其进行操作。
# create new branch
git checkout -b <name> <sha-1>
# "move" the current branch to any given commit
git reset HEAD --hard同样,所有这些都在上面的答案中进行了详细描述。
https://stackoverflow.com/questions/42044954
复制相似问题