Add git_restore_from function and refactor if-else

- Adds git_restore_from which prompts the user for confirmation and then
  fetches from the remote (arg1) then performs a hard rebase onto branch
  (arg2).

- Refactors some scattered if-else loops which had been poorly written
  as else if rather than elif.