Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git我已经签出了主控,但我想还原它_Git_Github - Fatal编程技术网

Git我已经签出了主控,但我想还原它

Git我已经签出了主控,但我想还原它,git,github,Git,Github,我一直在本地机器上使用GIT进行一个项目,我对GIT了解不多,但它一直运行良好,我定期添加并承诺回购,即 git add . git commit 在犯错误后,我还使用以下方法查看了以前的版本: ```git checkout 7640ac36f0a5cfe28bce7f8e5e5fc84f71ca6d71``` 我刚刚在github中创建了一个存储库,并按照我尝试分支项目的指示(按照指示)尝试将项目发送到github git分行-M main 这给了我一个关于头部分离的错误 然后我就这样

我一直在本地机器上使用GIT进行一个项目,我对GIT了解不多,但它一直运行良好,我定期添加并承诺回购,即

git add .

git commit
在犯错误后,我还使用以下方法查看了以前的版本:

```git checkout 7640ac36f0a5cfe28bce7f8e5e5fc84f71ca6d71```
我刚刚在github中创建了一个存储库,并按照我尝试分支项目的指示(按照指示)尝试将项目发送到github

git分行-M main

这给了我一个关于头部分离的错误

然后我就这样跟着

  • git branch我的临时工作
  • git签出主机
  • git合并我的临时工作
  • 我说错话了

    error: Your local changes to the following files would be overwritten by merge:
      .idea/codeStyles/Project.xml .idea/codeStyles/codeStyleConfig.xml .idea/encodings.xml
    
    现在我的版本比我希望的要早得多,我如何撤销它以返回到我以前的版本,然后使头部不分离,这样我就可以添加到远程Git Repo

    输出来自: git日志--图形--单线--全部--装饰

    * 0ade9cbf (my-temporary-work) This was the last commit before moving to remote repo
    * bc8c309f Commit before updating to android x
    * 6335ac8f updated the media player tidied things up still a work in progress.
    * fd08c4ab save before removing concatenating media source
    * d2869c0b Updated libs including exoplayer
    * 42d2fc20 GC some memory leaks found and hopefully rectified...
    * b06759f4 added leak canary to detect memory leaks
    * ef380de0 removed the unnecessary play fun from main and fav activities as it is implemented in parent class...
    * 7640ac36 commit after changing the on button pressed interface in audio fragments to inherit from the base audio fragment
    * 1377bdec changed exoplayer fragment to inherit from base audio fragment...
    * e35ff716 Commit before implementing bottom sheet factory...
    * eeedb7b3 good restore point still not really fully happy with play pause in playlist also more button not working yet
    * e5f0bc98 playlist fragment works better now good restore point still work to do to simplify it...
    * 24b666f2 playlist slightly improved now it is more dynamic getting the current items in the playlist need attention tho....
    * 60886c2a still working on playlist going to be a hybrid of the music live adapter and playlist adapter this will utilise diff utils and swipe delete
    * e6415800 Fixed a few compilation errors after changing from java to kotlin small changes of the companion objects
    * a24c707e Good clean up most fragments inherit from baseAudioFragment where delete and alter metadata is taken care of....
    * bb9d93a2 updated a base audio fragment to remove duplicated code.
    * d9d765fa deleting the media source doesnt throw an error now
    * 7ff42182 Delete looks like it works while its playing too
    * 61f99121 the delete fun in the exoplayer fragment throws a null pointer error this is semi sorted but an error is thrown if a new activity is started
    * cb51b6c2 Changed Exoplayer Music service to Kotlin
    * 0139aeb9 clean up the fav stopped working now is ok
    * eb7e4f2f Tidying up the Exoplayer Fragment changed to Kotlin
    * 09661181 Delete whilst in playlist now works...
    * 2bce752c removed some repetative code from activities for songs and placed it in base activity tested works fine
    * 54e04e3b added ISongExoPlayerCallback delete callback this will delete an id from the playlist before deleting the file from the media store
    * 4d9f242a commit after changing min api from 23 -> 30 and target 30
    * ab326226 Little Tidy up...
    * f148babc Getting there the delete works now this will be a model for the edit and add new file
    * 679df68e Commit before change metadata change
    * b93006fd Lots of changes
    * bdfd2a59 was trying to complete the change metadata class but i have had to return to change item dialog
    * a307b90d SdCard Fragment changed to only update the intent service when the item has downloaded fully
    * 68f84f7c sorted a few tings out sd card and downloads in api 29 play now
    * 48ca5fcf the sd card downloads play now using the url the artist etc still needs a coat of looking at...
    * d32506bc Audio Books and Podcasts works now...
    
    输出来自: 吉特分行-vv

    * master 277f6666 Reverting to old project my-temporary-work 0ade9cbf This was the last commit before moving to remote repo
    
    试试这个

  • git reflog
    ,这将显示所有提交
  • 找到你的承诺
  • git重置——硬

  • 进一步研究:


    • 请考虑在继续使用Git之前阅读一些有关Git的基础知识。我相信当我从Sa1中退出时,这会导致分离状态。这是正确的吗?我不确定:你到底是什么时候开始分离头部的,遥控器在这一切中意味着什么?你能发布git log--graph--oneline--all--decoration和git branch--vv的输出吗?谢谢winarcooo,省去了这一天的时间,准备花点时间学习git。