-1

Ok, so the online repo accidentally deleted a bunch of files when an uneeded branch was deleted. I have all the files locally, but they're unchanged, so it doesn't want to add or commit them back. I reset the HEAD to get rid of the out of sync messages, but if I do a git pull from master, it wants to delete a bunch of local stuff that I need.

So basically, I want to force it to take all my local files, unchanged or not, and push them to the online master repo.

I don't need to worry about messing up anyone else. I'm working on this project alone.

Adam Norton
  • 512
  • 2
  • 5
  • 21
  • If the files you want to save are in a commit, let's say on master branch, you can `push -f` to master. Thus, the commit with the files you want to save will end up on GitHub. – mnestorov Jun 12 '20 at 16:40

1 Answers1

0

Sounds like you have a similar case to Overriding remote git repository with my repository I believe a git push -f <remote> <branch> would work. You can refer to this answer post for additional considerations