How to recover commit removed?

5

Consider the following story:

  • In the local repository I committed A and B.
  • I pushed the repository on the server.
  • I went back to the local repository and made changes.
  • I removed commit B from the local repository (using the command below) before committing the new changes:
  • git reset --soft HEAD~
    

    How do I retrieve the removed commit from the local repository so that the history is the same as the server repository and without losing the changes that have not yet been committed?

        
    asked by anonymous 02.11.2015 / 19:38

    1 answer

    1

    Felipe

      

    To recover a commit from the HARD reset, just use git reflog.

    Source: link

        
    10.11.2015 / 21:18