What does `git reset --hard origin` do?

by cortez.connelly , in category: Third Party Scripts , 5 months ago

What does `git reset --hard origin` do?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by lily , 5 months ago

@cortez.connelly 

git reset --hard origin retrieves the latest changes from the remote repository and resets the current branch to match the origin branch. This means it discards all local changes and updates the working directory and staging area with the commits from the remote repository. It essentially reverts the current branch to the state it is in on the remote repository.