Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.4k points)

I was working on the master branch, made some changes and then stashed them. Now, my master is at HEAD.

But now, I want to retrieve these changes but to a new branch which branches from the HEAD version of the master branch.

How do I do this?

1 Answer

0 votes
by (119k points)

Is the standard procedure not working?

  • make changes
  • git stash save
  • git branch xxx HEAD
  • git checkout xxx
  • git stash pop

Shorter:

  • make changes
  • git stash
  • git checkout -b xxx
  • git stash pop

Also, check out this Git Tutorial to know more.

Related questions

0 votes
1 answer
+1 vote
2 answers
0 votes
1 answer
0 votes
2 answers
asked Jul 24, 2019 in DevOps and Agile by chandra (29.3k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...