I created a feature branch from the master branch, made some changes. Then I forgot to stage and commit them into the feature branch, and hadn't touch the repository for a while.
Recently, I went back to the repository, without remembering what I did, and switched to the master branch. I guess that at that point the changes remained in the working directory, and I accidentally committed the changes into the master branch.
Now When I switch to the feature branch, the feature branch doesn't have the changes i.e. is like the original master branch, and the master branch has the changes i.e. is like what the feature branch should have been.
I did a git diff feature..master
, and the only difference between them is the changes.
How can I correct the mistake?
Thanks.