bluethundr
bluethundr

Reputation: 1325

reset git branch to earlier checkout

I've reverted my local branch in git to an earlier version with this command:

git reset --hard ab5a3914c73

How can I get that version to be the current version of my git branch? I want to overwrite all previous commits with this version.

Upvotes: 0

Views: 71

Answers (1)

Bill
Bill

Reputation: 1425

If you are asking how to update the remote branch, you would need to force push, git push -f. If you are working with a team, it should be a coordinated effort. Also, depending on your server-side settings, force pushing to a branch may be restricted.

See: Git Push

Upvotes: 2

Related Questions