cnewbie
cnewbie

Reputation: 189

Does a `git reset --hard upstream/main` delete also local branches?

If I do a git reset --hard upstream/main, will also my local branches be deleted by that command?

Upvotes: 0

Views: 567

Answers (1)

Schwern
Schwern

Reputation: 165298

git reset does not delete branches.

git reset --hard upstream/main says to move the currently checked out branch to the same commit as upstream/main, and to clear your staging area of any changes, and to overwrite your files with the versions at upstream/main.

Your current branch will be at the same commit as upstream/main, and any staged or unstaged changes will be gone.

Upvotes: 1

Related Questions