Given a project with two files: fileAand fileB. Both have been added to the git repository. Then I added fileAto .gitignore(and dropped git -cache), so itβs only fileBpresent in the current main . I would like to clone this repository to another computer, but fileA is missing.
fileA
fileB
.gitignore
The next thing I did was create a branch from a commit, in which both files were present. Now the big question is: how can I return to the master commit without losing this file again?
Sorry for the title. I tried to describe, but ..
, git checkout:
git checkout
$ git checkout <revision_where_fileA_exists> fileA $ git add fileA $ git commit -m "Restored fileA"
.gitignore, fileA.
, Josh , , , , , ... , -f, , . git .
$ git checkout master $ git pull -f . <branch>:master
, . :
$ git reset $ git revert
Reset , , , , , .
, . "" .
Source: https://habr.com/ru/post/1734597/More articles:VS2008 Non .NET Application - vb.netC ++ templated functor in lambda expression - c ++Removing zombie locks in Subversion - svnSimulate the Back / Forward / Refresh button in a unit test using Wicket - unit-testingThe right way to make data sources / resources install installation time - deploymentNLP project, python or C ++ - c ++Reading and writing a file - androidSerializing POST Requests jQuery / Javascript - javascriptCustomizing the SpringSource wth AspectJ toolkit - javaBasic Data for Many NSPredicate with AND - cocoaAll Articles