0

I tried to change branches in VisualStudio (on Git). Half way through the change VisualStudio said it was out of memory and stopped.

I am still on the original branch, but VisualStudio is now saying I have 1428 files that are changed in that branch that I need to push before I can change branches. I assume these are the files it was copying down for the branch I want to change to.

I right click and select "undo changes." Visual Studio asks me if I want to undo those changes. I say yes, it says it's doing it and... all those files are still there.

How do I get rid of all these changes in the one branch?

And how do I switch to the other branch?

thanks - dave

David Thielen
  • 28,723
  • 34
  • 119
  • 193

1 Answers1

0

Open command line and type git reset - - hard then git checkout yourbranch.

MistyK
  • 6,055
  • 2
  • 42
  • 76
  • Will that delete or undo changes I have already pushed to Git? Or just the changes on my computer? thanks - dave – David Thielen Dec 02 '17 at 21:17
  • It will undo current changes to last commit on current branch – MistyK Dec 02 '17 at 21:18
  • I don't want that. I did a push (that's a commit - right) and the changes pushed we do need. It's just the changes on my computer I need to undo. – David Thielen Dec 02 '17 at 22:08
  • you need to read a little about git, if you pushed your changes they will not be touched. git reset --hard will remove all your uncommited changes. If you wanted to change a branch and it was working it means that all your changes were commited. After calling git reset --hard all should be fine. – MistyK Dec 03 '17 at 01:09
  • I tried that - it didn't work. It still shows all these files I've added and changed on my system it wants me to check in. – David Thielen Dec 09 '17 at 12:53