Reputation: 1245
I am using bitbucket with GIT. i made a mistake by committing and pushing some code to the master branch , i thought i was doing to dev branch. To revert I did "git reset --hard HEAD~1" then did "git push --force" , this removed the commit and made reverted the master to previous commit all good i think. Now i want to push my local changes to dev branch , So i did "git checkout dev" then hit "git status",I got
Your branch is up to date with 'origin/Dev'.
nothing to commit, working tree clean
I still see all the changes in my local then why is git saying no changes ? how can i push the changes in my local to the dev branch ?
Upvotes: 0
Views: 588
Reputation: 1719
When you committed your changes to master initially and did git reset --hard HEAD~1
, that commit is gone for good. Now, there are no changes in your local. If you still want to get that commit id and apply it to dev branch, do git reflog
, find the commit id, checkout dev branch and cherry pick it.
Upvotes: 3