简体   繁体   中英

Deleted origin branches. Need to restore them

I was using branches for this exercise project and thought I should delete branches after I'm done. However I well prepared for what to delete and how and now I'm in a pickle. I found SO questions about restoring deleted branches, however I ran into another problem. I removed the appsettings file from my worktree and as can be seen from the two screenshots below, when I try to pull, it says I don't have any local changes and when I use git checkout , it says I do have local changes to the appsettings file. Keep in mind, I made the changes not from my local repo first, but from the remote one. I'm not sure why. I wanted to remove the sensitive information as soon as possible.

first

second

Actually, you use git pull / stash in wrong way:

  1. To commit something, you should add it to commit: git add some-file && git commit

  2. Before stashing , you should better to add files

  3. Finally, check git status before pulling , it shouldn't have any changes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM