How to move a branch backwards in git?

Use the reset subcommand:

git checkout A
git reset --hard B
git push --force github

As a sidenote, you should be careful when using git reset while a branch has been pushed elsewhere already. This may cause trouble to those who have already checked out your changes.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)