News for hackers. Stuff that matters.
Re:Idiot Proof Git by est on Thursday November 10, 2022 @01:54AM (#33543124)
> since you often aren't allowed to rewrite history on the remote

For dev branches it's easy, `git reset --hard` on local then `git push -f` again. This command combination is not that intuitive for beginners.

I agree this action is sometimes hard to recover e.g. on protected branch, so a warning must be given to the user.

Re:Idiot Proof Git by hoseja on Thursday November 10, 2022 @04:53AM (#33544344)
You can also `revert` which, while staying in history, needs no warning.
Re:Idiot Proof Git by stephen_g on Friday November 11, 2022 @12:35AM (#33557642)
Assuming your remote allows you to force push. Also you need to specify where to reset to because 'git reset --hard' will just reset you to HEAD, so you actually need to do 'git reset --hard HEAD~' (usually I don't use --hard for this either because often there's some work I want to keep from the commit).