├── .gitignore └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | #Pods/ 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Git教学:如何找回Git删除的提交 2 | 3 | 仅仅是个演示如何找回Git删除的提交,我并没有源码 4 | 5 | 不要找我发邮件要源码了,我并没有源码。不过这个readme会更新的 6 | 7 | 你们这些点Fork的是什么心态。。。点Watch就行了 8 | 9 | ## **中文:** 如何找回Git删除的提交 10 | 11 | 1. Clone一下这个仓库,下面教你找回代码。 12 | 13 | ``` 14 | git clone https://bitbucket.org/liruqi/newebuy.git 15 | ``` 16 | 17 | 2. 找一找哪一个是代码删除之前的提交 18 | 19 | ``` 20 | git log 21 | ``` 22 | 23 | 3. 把git的HEAD头指向之前代码还在的hash 24 | 25 | ``` 26 | git reset 45ac382f --hard 27 | git clean 28 | ``` 29 | 30 | 4. 哈哈,现在你找回来了 31 | 32 | ## **English:** Learn Git: Restore the commit which has already removed 33 | 34 | It's only a demo. I don't have the source code. 35 | 36 | 1. Clone this repository. [origin url](https://gitlab.com/xd09/NewEBuy) 37 | 38 | ``` 39 | git clone https://bitbucket.org/liruqi/newebuy.git 40 | ``` 41 | 42 | 2. Seek the commit before remove 43 | 44 | ``` 45 | git log 46 | ``` 47 | 48 | 3. Set Head to the commit before remove 49 | 50 | ``` 51 | git reset 45ac382f --hard 52 | git clean 53 | ``` 54 | 55 | 4. Now you get the origin code 56 | --------------------------------------------------------------------------------