Help !! #147332
-
|
we were writing a project with our colleagues. but a stranger changed the codes in our repository and wrote a commit, but he has no such right. how can this be |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
You can rollback the commits. If you want, change the repo to a private one via the settings and then invite your colleagues personally.
|
Beta Was this translation helpful? Give feedback.
-
|
Can I push the changes he made from the commit history? |
Beta Was this translation helpful? Give feedback.

You can rollback the commits. If you want, change the repo to a private one via the settings and then invite your colleagues personally.
That way, no one else cant view it only your colleagues can.
Use git revert to undo the commit while maintaining history.
If you lack branch protection rules, anyone with push access can make direct commits. On GitHub: Go to Settings > Branches and check if Branch protection rules are configured for key branches like main or master.
Enable branch protection rules to: