Restore changes that were overwritten by git pull

This question already has an answer here:

  • Git pull deleted uncommitted changes

    3 answers

  • Git fetch origin vs git fetch --all
  • Pull remote branch into local repo with different name?
  • How to retrieve git Commit Id from a C# Application?
  • git refuses password, only when logged in as root
  • GIT: How is safe concurrent push implemented?
  • git repository with read only permissions
  • Cloning a read-write github repository using TortoiseHg
  • GitLab: No tracked branch configured for branch master
  • Implement pwinty API using Java library
  • “${1-}” vs “$1”
  • can I store password somewhere using git via http(not https)
  • Push to gerrit using SourceTree
  • One Solution collect form web for “Restore changes that were overwritten by git pull”

    As mentioned in the question, a solution I used to restore my changes was using git’s lost-found.

    I used cd .git/lost-found/other/ to take myself to the lost and found where the files were.

    I opened each file in the directory to see what it’s name was, then moved it to the correct directory with the correct name.

    I used git add to add the changes and commit them, so now I won’t lose them again.

    Git Baby is a git and github fan, let's start git clone.