相关疑难解决方法(0)

使用Git恢复基于提交ID的特定提交?

有了git log,我得到了我到目前为止提交的一系列提交.

commit f5c5cac0033439c17ebf905d4391dc0705dbd5f1
Author: prosseek 
Date:   Fri Sep 3 14:36:59 2010 -0500

    Added and modified the files.

commit c14809fafb08b9e96ff2879999ba8c807d10fb07
Author: prosseek 
Date:   Tue Aug 31 08:59:32 2010 -0500

    Just simple test for core.editor.

... etc ...
Run Code Online (Sandbox Code Playgroud)
  • 如何将其还原为特定提交?例如,如果我想回去,我该怎么办commit c14809fafb08b9e96ff2879999ba8c807d10fb07

  • 有没有其他/更好的方法回到Git的特定提交?例如,我可以将每个提交的一些标签放回标签中吗?

git

302
推荐指数
4
解决办法
48万
查看次数

如何将HEAD移回以前的位置?(独立头)和撤消提交

在git中,我试图squash commit通过合并另一个分支然后HEAD通过以下方式重置到上一个位置:

git reset origin/master
Run Code Online (Sandbox Code Playgroud)

但我需要走出这一步.如何将HEAD移回上一个位置?

我有23b6772提交的SHA1 frag(),我需要将其移动到.
我怎样才能回到这个提交?

git git-revert git-checkout git-reset git-reflog

141
推荐指数
4
解决办法
17万
查看次数

标签 统计

git ×2

git-checkout ×1

git-reflog ×1

git-reset ×1

git-revert ×1