Ho completamente incasinato il ramo principale del mio repository git biforcuto.
Voglio ripristinare completamente il ramo principale che è stato inserito nel mio fork con il contenuto del repository principale a monte. Non ho alcun interesse a conservare le modifiche o la cronologia del ramo principale.
L'approccio più semplice sarebbe stato quello di eliminare il mio repo biforcuto e refork dal progetto a monte. Tuttavia, ho del lavoro in altri rami spinti che non voglio perdere.
Quindi come resettare il mio ramo master pushed con il master upstream?
git clone https://myrepo.git
cd myrepo
git remote add upstream https://upstream.git
git fetch upstream
Dove devo andare da qui per ripristinare i miei rami master locale e remoto con il master a monte?
git reset --hard upstream/master
anche il ripristino della directory di lavoro. Ma la tua risposta è comunque corretta.