Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7786461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:25:15+00:00 2026-06-01T20:25:15+00:00

I am newbie in git and I am working on git. I added some

  • 0

I am newbie in git and I am working on git.

I added some files in git :

git add <file1>
git add <file2>

then I wanted to push that for review, but mistakenly I did

git commit

so the files which I have changed don’t go for reviews.
Now if I enter the command :

git status

it says

# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)

I want to revert that commit and I want to push those files for review rather than commit.
Can anyone let me know how I can do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:25:16+00:00Added an answer on June 1, 2026 at 8:25 pm

    You cannot push anything that hasn’t been committed yet. The order of operations is:

    1. Make your change.
    2. git add – this stages your changes for committing
    3. git commit – this commits your staged changes locally
    4. git push – this pushes your committed changes to a remote

    If you push without committing, nothing gets pushed. If you commit without adding, nothing gets committed. If you add without committing, nothing at all happens, git merely remembers that the changes you added should be considered for the following commit.

    The message you’re seeing (your branch is ahead by 1 commit) means that your local repository has one commit that hasn’t been pushed yet.

    In other words: add and commit are local operations, push, pull and fetch are operations that interact with a remote.

    Since there seems to be an official source control workflow in place where you work, you should ask internally how this should be handled.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am newbie with git. It tried this tutorial, but after the command, i
Git newbie here. I am probably making a simple mistake here, but I can't
GitHub Users, I am newbie on github and have some issue with git setup.
I am a SCM newbie, but I just need some basic things for version
I'm a newbie to git, and I do understand how git cherry-pick works, but
Git newbie here. Is there a way to synchronize two repositories, so that the
The issue is that I can not 'git push' changes from my netbook, to
Using git log I found an old version of my project that I wanted
I'm a Git newbie. I recently moved a Rails project from Subversion to Git.
I'm a newbie at git and want to understand how to collaborate with a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.