masterYao09
masterYao09

Reputation: 15

How to restore commit history on github?

So one of my team mate changed the directories of our files, I'm not sure if he just moved our files or created a new one and copy pasted the code to that new file. But now some of our files lost all of it's commit history, and there is only one commit. How can I restore the commits history even though the directory has changed or he copy pasted the code to new files with the same name.

Upvotes: 0

Views: 66

Answers (1)

eftshift0
eftshift0

Reputation: 30156

You might force the commit ID into the branch you want:

git push -f remote-i-want id-i-want:remote-branch-i-want

That will set the history of the remote branch to whatever revision id you want.

Upvotes: 1

Related Questions