我对这个git很陌生,就我的经验而言,我从来没有遇到过这样的事情。git commit,git stash和git stash pop后不会出现提交的文件
我有多个本地分支,我经常切换,因为我使用一个组,并使用其他分支作为参考。
在这种情况下,我的一个朋友承诺并将某些东西推送到他的分支,他建议我们看看。
所以我在自己的分支上进行了修改,但像往常一样,有些Xcode文件在我们打开它们时会自动编辑它们,所以我认为它们是一个好主意, )并在稍后处理它们,这样我就可以检查我的朋友的分支并获取更新。
完成后,我切换回我的分支,并做了git stash pop
,并检出了并非真正重要的文件。
然后我注意到我创建的文件不见了。
我试图做一个git revert
但它什么也没做,不是我理解发生了什么事情。
这里是我把命令列表:
git add Integra-Geochemistry/Controllers/WaterSamplingFormOneViewController.swift
git add Integra-Geochemistry/Views/WaterSamplingFormOneView.swift
git add Integra-Geochemistry/Xibs/WaterSamplingFormOne.xib
git status
git commit -m "Initial commit - added WaterSamplingForm"
git status
git branch
git branch dev/surface-thermal-sampling
git checout dev/surface-thermal-sampling
git checkout dev/surface-thermal-sampling
git stash
git status
git checkout dev/surface-thermal-sampling
git pull origin dev/surface-thermal-sampling
git branch
git status
git branch
git checkout dev/watersampling
git status
git stash pop
git checkout Integra-Geochemistry/Xibs/AddRadonFormView.xib
git checkout Integra-Geochemistry/Xibs/RadonReadingFormFourView.xib
git checkout Integra-Geochemistry/Xibs/RadonReadingFormThreeView.xib
git checkout Integra-Geochemistry/Xibs/RadonReadingFormTwoView.xib
git checkout Integra-Geochemistry/Xibs/RadonReadingFormView.xib
git log
git revert 63947089d3479fff91ae4fb2ba5d59bd39d0c30d
仅供参考,这里的日志文件(以后我做的混帐复归)
commit 8f5a3b8a4db5bad0a750ba08cd2d5b6a8a2fe18e
Author: <-------->
Date: Tue Jan 5 17:28:19 2016 +0800
Revert "Initial commit - added WaterSamplingForm"
This reverts commit 63947089d3479fff91ae4fb2ba5d59bd39d0c30d.
commit 63947089d3479fff91ae4fb2ba5d59bd39d0c30d
Author: <-------->
Date: Tue Jan 5 17:13:35 2016 +0800
Initial commit - added WaterSamplingForm
我已经做了很多承诺的,推动和转换分支,但我从来没有像这样消失在我身上。
有没有机会我的文件可以恢复?我讨厌重新开始。谢谢。
相关问:HTTP://计算器。com/questions/34519665/how-to-move-head-forward/34519716#34519716 – CodeWizard