How can I hide my changes and return to my last registration in Git?

The story goes like this:

I forked my repo to try and make some changes to the way my wcf works. I checked my changes in my new branch a day ago when everything was dandy, before I started a little weird with wcf. Then I started checking out some things that actually didn't work, although I think I'm on the right track.

Now I do not have time to continue to try this, so I would like to return to my last registration, but I do not want to lose this material forever. Is it possible?

+4
source share
2 answers

You can program it (using git stash ), in which case your working directory will be reset until your last session (i.e. your HEAD).

Or you can branch the current branch into a new branch and then commit your changes there. I prefer to use branches in posts whenever possible, I see workpieces as a much more temporary / temporary tool.

+4
source

I suggest quickly putting your work in another thread:

 git stash git checkout -b new-branch-name git stash apply git commit -a -m "commit message here" git checkout current-branch-name 

You can only make part of git stash , but then your things will be in a monolithic stack forever. It’s better to place it somewhere so that it can be found again, since later you will need a queue for queues.

+2
source

All Articles