![]() ![]() 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. d is to also remove untracked directories and f. On git, you'd simply do: git reset -hard to discard changes made to versioned files git clean -xdf to erase new ( untracked) files, including ignored ones (the x option). ![]() Others have pointed out the methods to do this: On SourceTree for Windows, right click the files you want to discard (in the Working Copy Changes list), and choose Discard. To be clear: I am not trying to modify my remote repo, just get my local repo to look like the server. now your branch will updated without your last commit. 2) Your commit will list like, Recent will appear at the bottom of the page LILO (last in Last Out) Delete the last commit row entirely. 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). the above commands removes the latest commit, then push using. 1) git rebase -i HEAD2 will show your recent 2 commits. 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. Then when you want to push your changes remember to use the -f flag because you modified the history. 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 reset -soft HEAD (number of commits you'd like to revert) git commit -m 'The stuff you didn't like.' git log copy the hash of your last commit git revert .Git pull says my local repo is "up to date" Then, right click on a specific commit, and select 'Reset current branch to this commit'.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |