0

I had some uncommitted changes on my local and I wanted to send a pull request. I did a git pull --rebase and forgot committing my local changes.

The git pull --rebase has removed all my unsaved/uncommitted contents. How do I get them back?

I don't mind reverting the rebase, all I want is my uncommitted changes back.

Varun Gattu
  • 43
  • 1
  • 10
  • Possible duplicate of [Recover from git reset --hard?](https://stackoverflow.com/questions/5788037/recover-from-git-reset-hard) – phd Apr 15 '18 at 18:26
  • 1
    Note that `git pull` is *supposed* to announce that you have unsaved work and refuse to run (`Cannot pull with rebase: You have unstaged changes` or `Cannot pull with rebase: Your index contains uncommitted changes`). – torek Apr 15 '18 at 19:31

1 Answers1

2

See here. As that answer says, unless the changes were staged or stashed, you cannot recover them. However you could try using Undo in your IDE, it may undo the changes from the git pull.

EDIT: If you're really desperate you could look into reverting at the OS level if you have set up something like Windows Recovery or OS X Time Machine.

MrKagouris
  • 106
  • 1
  • 8
  • I unfortunately did not stage/stash. Nor can I do the OS level revert on my office machine. I think I lost them, thanks for the answer though. – Varun Gattu Apr 15 '18 at 18:04