kaktusas2598
kaktusas2598

Reputation: 691

Switching to new git branch, revert some changes in NetBeans

I was editing default layout file in my CakePHP project and created new branch, as I will need it to check new functionality. Problem is, when I switch to new branch, my default layout file reverts to it;s state, like it was few commits before. I need to have it's current version to add new functionality to it, and when merge my branch to master.

Maybe this behavior happened, because my workflow was like this:

Upvotes: 2

Views: 766

Answers (1)

VonC
VonC

Reputation: 1326686

I commited all my changes to master after creating new branch :) And it was before switching

Then it seems normal to see a previous state when you switch to the new branch.
Try merging the branch (say master) from which the new branch was created:

git checkout newBranch
# see old content
git merge master
# should see newer content

Upvotes: 1

Related Questions