![]() ![]() Copy the contents of that version (Ctrl-A Ctrl-C) and paste it over the actual current version. This pops up a temporary file with the contents of the desired version. In these scenarios, git revert should be the preferred undo method. In the history window, find the commit for the version you want to test with. Git reset -hard HEAD (reset the index and the working tree to the last commit), but it's worth having an understanding of what you're trying to achieve - if I'd known how git was tracking my files the first time I messed up my working tree, I'd have saved hours of fretting. Git will assume that the branch being pushed is not up to date because of its missing commits. Others have pointed out the methods to do this: To be clear: I am not trying to modify my remote repo, just get my local repo to look like the server. ![]() There's a nice diagram on the bottom of this page which shows you how the process works - you make some changes, stage them (by running git add), and then finally commit them to the repository (through the creatively named git commit). Git doesn't compare the changes that haven't been committed to the remote branch when it decides what to pull thus, from Gits point of view, your local and remote repositories are at the same point in time, even though your local repository has unstaged changes (changes that you have not git added). This is due to your git push, which synced the remote with your local repository. Insights Closed on 11 comments firestar9114 commented on The first is to create a branch at the old point in history, and then checkout that branch so that the worktree files are updated to match exactly that commit. Git pull is telling you your repository is up to date because your local repository and your remote repository both point to the same HEAD (the last commit). ![]() Git pull says my local repo is "up to date" In case youre using the Tower Git client, you can simply hit CMD+Z to undo the last commit: You can use same, simple CMD+Z keyboard shortcut to undo many other. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |