Skip to content

My folder is not tracked by git #22205

Discussion options

You must be logged in to vote

You can check your logs to go back to a previous point in time.
The following steps assume you deleted the contents and then made commits after.
To find the right commit, first check the history for the deleted file:

$ git log -- <filename>

You can either work with the last commit that still had the file, or the commit that deleted the file. In the first case, just checkout the file from that commit:

$ git checkout <commit hash> -- <filename>

In the second case, checkout the file from one commit before that:

$ git checkout <deletion commit hash>~1 -- <filename>

If the file was never actually committed this of course will not be in the history.

You mentioned:

Then on my other PC, there…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants