是否可以从git reflog
收到的数据中恢复git提交?
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
输出的示例。
str.match(/&&.{2,64}?&&/g)
答案 0 :(得分:2)
当然。
在这里阅读所有相关内容: 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
再次在上面的答案中详细描述了所有内容。