Excuse me. The author understands that he is "uh idiot, as it is generally possible, take your hands off the keyboard, do not touch her anymore."
There was a project tracked by git th, flooded on bitbucket (probably it does not matter). At some point I wanted to change the author’s name to a large number of commits. To do this, I used the team from here , without having read the warning. Team:
$ git filter-branch --env-filter ' WRONG_EMAIL="wrong@example.com" NEW_NAME="New Name Value" NEW_EMAIL="correct@example.com" if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ] then export GIT_COMMITTER_NAME="$NEW_NAME" export GIT_COMMITTER_EMAIL="$NEW_EMAIL" fi if [ "$GIT_AUTHOR_EMAIL" = "$WRONG_EMAIL" ] then export GIT_AUTHOR_NAME="$NEW_NAME" export GIT_AUTHOR_EMAIL="$NEW_EMAIL" fi ' --tag-name-filter cat -- --branches --tags Then the most terrible things that I could do were done, namely: git fetch , git pull , git push .
Now in my beatback every commit is now duplicated (but with a changed name).
Namely, the question is: is it possible to return everything back? I understand that I "rewrote history", but I do not seem to understand that this is very dangerous.
git push --forceimmediately after rewriting the history. Add a question: what doesgit statusandgit reflog? I think that you can dogit reset --hard HEAD@{1}+git push --force, but first you better make a copy of the project folder and show the output of the commands. And then you can easily aggravate the situation even more. - AK ♦a и pusha. Then, for example, write git reset --hard a0d3fe6, where --hard a0d3fe6 is the hash of your action to roll back (after execution, you will lose all local changes from this commit). Make a copy of the local repository just in case before doing all this. - Dmitriy