Finding a missing file between commits

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

This article will help to identify the files that were added in the past commit but currently missing.

Environment

Bitbucket Cloud

Solution

Compare the diff between the commit which has the files to the current HEAD of the branch (which had the files removed).

You can use the ---name-status flag so that your search will show a list of modified files:

1 git diff --name-status HEAD HEAD~11

This would output something like this:

1 2 3 4 git diff --name-status HEAD HEAD~11 D Archive.zip M bitbucket-pipelines.yml D testtest.txt

This would show you a quick example of where the file was deleted in reference to HEAD. You can change the HEAD~11 to a different number to point where the file was added.

Updated on February 25, 2025

Still need help?

The Atlassian Community is here for you.