My committed/pushed changes to master don't show in my local repository after I did a recent pull

Dear Git experts, I am not an Git expert.  I am currently only able to use Git Gui as I never was able to figure out how to use command line eventhough I see Git Bash Here and Git GUI Here options.

Background: I’ve been committing and pushing my local changes to master remote branch via branches (which are created on master or somewhere else by Git admin and I just select new branch and type-in that branch name and check in my changes to it. I don’t create any branches on my local) . All work I do is on my local repository. When I am done with my development work, I just click Git Commit --> specify a branch name -> check in -> and then Push.

My dilemma:  Very recently when I was trying to push some changes, Git failed to do so and said I need to pull or fetch so that I’ve latest changes from master on my local for the work that was done and committed by other developers. Hence I did a pull and now I don’t see all my changes on my local that I’ve already commited/pushed to master via different branches. I was expecting that once I did a pull from master, it should have copied everything to my local repository that has been commited/pushed by me as well as from other developers  to master as of last checkin/commit/push. I’ve tried to do master pull, fetch_head pull it says my local is “Already up-to-date.”. Can anyone please help how should I get my local repository synched up with master so that all my previous changes that I’ve committed/pushed into master show on my local?

Also, I never did a merge. I thought after I do commit and push, it pushes all changes to master. I am bit confused here so really appreciate any help. 

Hi @gitbaby2018! If you’ve committed the changes locally, then done a pull from the remote repository, your committed work should still be there. It won’t be the most recent local commits, but they should be somewhere. If you push, your changes will then be pushed to the remote.

However, if you aren’t seeing your changes anymore, I’d be worried about if you hadn’t actually fully committed the changes before pulling. If you push, are you able to see your changes on the remote? 

Hi, thanks for your reply. Yes my changes are available in remote. What i am surprised is how is it possible that all my local changes can get lost with some clicks in error and Git not giving enough warnings. 

So basically, here is my work flow used to be:

(things that I did outside of Git GUI)

say my local repo is on: c:/mylocalGitrepo

-then under it i’ve several folders like admin, manager, employee

-then i modify/add new files in “admin, manager, and employee” folders.

-once i am done i then go to Git GUI

(things that I did in Git GUI)

-i then right click in c:/mylocalGitrepo folder and click TortoiseGit–>Add (for new files) or if no new files and just modified existing files then select Git Commit-> Weekly branchname (WEEK1, WEEK2, etc…). 

-i then provide a new weekly branch name, add comments, make sure files being commited are correct and  “Commit” button

-Once commit is done it pops up another window asking me if I want to push those changes

  • i then push those changes. 

That’s all I used to do and never had to do anything else like merge, sync etc. My local used to contain all my new files plus new changes and remote also used to contain my latest changes. But now my local is like very old copy of the repo that i had started with. i don’t know what i did. 

Hm, I see how that would be very confusing. Unfortunately, I don’t use the Git GUI on a regular basis, so I’m not sure exactly what could cause your local repository to roll back to a previous version. I’m sorry I can’t answer how, because I know it would be ideal to recognize what caused this so it can be avoided in the future.

For your current repository, to make sure you haven’t lost any work, have you been able to get the changes back to your local environment from your remote?