在Git Extensions中,我想回到存储库中所有文件和文件夹的旧版本,并立即将所有这些文件和文件夹作为该分支的最新版本签入。我没有待处理的未跟踪或未检查的更改。 我不希望还原#39;个人提交,或者只是回到旧版本并查看它,或者挑选单个提交,或者根据旧版本创建一个新分支。 我基本上想要做一个批量(一次性)恢复所有提交,因为我想要回到修订版。如果我签出旧版本,那么我无法提交它,因为它显示相对于该修订没有任何改变。 (我看到可以在Git命令行中进行批量恢复。)
答案 0 :(得分:1)
Git重置可能对您有所帮助,例如
git checkout <commit>
git reset --soft <branch>
git add -A
git commit
在此之后,您需要再次显式检出分支,并执行(快进)合并到您在上述步骤中创建的提交。
答案 1 :(得分:0)
假设你在那里:
branch
如果您想将A
重新设定回B--C--D
,然后将git reset --hard
丢弃,请使用# from branch :
git reset --hard A
# if you have a remote, you should 'push -f' to it :
git push -f origin branch
# the history will be reverted to :
--*--*--A <- branch
:
B--C--D
如果您希望将A
保留在历史记录中,但将内容设置回# from branch :
# checkout the *content* of A (notice the '.') :
git checkout A -- .
# commit this as a new commit on top of D :
git commit
# the history will now be :
--*--*--A--B--C--D--A' <- branch
中的内容,则应该:
kafkaListenerContainerFactoryConfigurer